cljc - a clojure compiler in clojure
This is the home page of my compiler project: A version of the
clojure compiler written in clojure.
The code is hosted at github.
Bootstrapping
cljc should now be able to compile itself with some trivial modifications.
To do a clean 3-stage bootstrap:
- Create two copies of the code in two different namespaces, e.g.,
boot.compiler and boot.compiler2 and likewise for the binfmt and class-file
libs.
- Change any uses of require, load, and use of the org.subluminal libs to
org.subluminal.compiler/load-file (stage 2) or
boot.compiler/load-file (stage 3). Require and load would delegate
to clojure.lang.Compiler.
The cljc-boot tarball demonstrates this.
Using this package the bootstrap should go as follows:
> (clojure.core/require 'org.subluminal.compiler) ; stage 1
> (in-ns 'org.subluminal.compiler)
> (compile 'org.subluminal.boot.compiler) ; stage 2
> (in-ns 'org.subluminal.boot.compiler)
> (compile 'org.subluminal.boot.compiler2) ; stage3