Implementing MAL


I did it! For those of you who don’t know yet, MAL is a Clojure-like language specially made for getting into the language implementation business. It is significantly less work than implementing R5RS, comes with loads of test cases, a step-by-step guide, many existing implementations[1] and an implementation in MAL itself which is used to test self-hosting.

My implementation is fairly standard. As much as people love hating on Emacs Lisp, it has proven to be a perfectly viable choice for writing interpreters. I doubt picking Common Lisp or CHICKEN would have made for much nicer code.

If you’re wondering whether to implement MAL as well, go for it! It will teach you how interpreting Lisp works and that writing an interpreter is easier than it looks like. While it doesn’t need to be in a language not featured in its repository, it’s nice to contribute a new one.

To run the implementation, check out the MAL repository, change into its directory and run emacs -Q --batch --load elisp/stepA_mal.el. Development was done on Emacs 24.5 with brief testing on Emacs 24.3 as it is still a fairly popular implementation.

Here’s a few random notes I’ve made while writing this thing:

[1]At the time of writing, 46 implementations have been handed in already.