The Ferret Lisp System

Nurullah Akkaya has an interesting project, Ferret, that compiles a Lisp dialect into C++. It’s very portable and can compile code not only for the major platforms but for embedded systems as well. Basically anything that can support C++ can be used as a target.

The system is written in Clojure so it would normally fall outside of Irreal’s interests but it has one feature that makes it very interesting to Irreal: The source of the whole system is a single Org mode file. If you had any doubts as to whether Org could support a literate programming approach in a non-trivial project, you can put them aside. If you follow the above link, you’ll see a beautifully rendered manual complete with the source code presented in literate form. For example, if you click on the Compiler section, you’ll see the actual compiler code along with an explanation of what it’s doing.

All of this is generated from the ferret.org file (which I’ve linked to in RAW format so you can see how it works). If you look at the Makefile, you’ll see that it calls Emacs in batch mode to tangle the ferret.org file into the various files needed for the runtime and compiler.

This is an outstanding example of literate programming made all the better by leveraging the power of Emacs and Org mode. Take a look even if you aren’t interested in Lisp or Clojure. The way Akkaya ties everything together in a single Org file is instructive and worth study.

This entry was posted in General and tagged , , , . Bookmark the permalink.