Newmoon is a naïve continuation-passing-style-transform based compiler for a language asymptotically approaching R5RS Scheme. The code has a long convoluted history not worth recounting; suffice to say that I’ve learned a lot from working on it through its many phases of development. The system supports multiple backends, emitting code for the JVM, the .NET CLR, and for a custom C runtime. It’s relatively retargetable, though there’s a lot of commonality between the backends I’ve written so far that should probably be factored out.

It’s very much a research project, not currently in a particularly usable state. It’s not yet self-hosting, though that’s an obvious destination for it; the current system requires MzScheme to run.

The code is released under the GNU LGPL.

Backend Status

The .NET backend was the first to be written, and has its own runtime written mostly in C#. It has run on Mono as well as Microsoft .NET.

The JVM backend is written to cooperate with SISC’s runtime, and was a fairly quick exploratory hack.

The C backend is GCC-specific, taking advantage of GCC’s special syntax for block expressions. The runtime is new, incomplete, and based on Baker’s Cheney-on-the-M.T.A. idea, just like Chicken.


Newmoon is hosted on github.