Build Your Own Lisp(buildyourownlisp.com) |
Build Your Own Lisp(buildyourownlisp.com) |
If you're curious but want a more language-agnostic guide, mal (Make a lisp) is a language+project that has a guide you can follow along with basically any language, and if you get stuck, you can look at already implemented versions in practically any language: https://github.com/kanaka/mal
Personal favorite implementations of mal: nasm (assembly) (https://github.com/kanaka/mal/tree/master/impls/nasm) and wasm (https://github.com/kanaka/mal/tree/master/impls/wasm)
mal has also been discussed many times on HN (which is probably how I came across it the first time too) for close to a decade by now: https://hn.algolia.com/?query=kanaka%2Fmal
I had fun making an interpreter in ARM assembly:
https://github.com/marcpaq/arpilisp
Since the world obviously needs another book on Lisp-making, I'm thinking of porting it to arm64 and expanding it into a book.
I only really cheated once (by looking at an existing implementation) and that was when I was implementing macros. I discovered I'd misread something in the MAL guide and was doing the correct things, but in the wrong order.
I'm now doing MAL again in Rust as a way of going up the Rust learning curve, and when I've done that (or enough) I'm going to see if I can code a garbage collected version of MAL (probably using 'Crafting Interpreters' as a guide - another really superb instructional resource).
But I am a hack in everyway, so it could just be me.
https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
Ah, to be young again!
Only 260 lines of code, pretty concise :)