When I was an undergrad, having newly read SICP, I start to write my own lisp in.... drumroll... matlab!!! I actually made quite a bit of progress before giving up. Ah, to be young again!
Only 260 lines of code, pretty concise :)
11–13 of 13 posts
When I was an undergrad, having newly read SICP, I start to write my own lisp in.... drumroll... matlab!!! I actually made quite a bit of progress before giving up. Ah, to be young again!
Only 260 lines of code, pretty concise :)
When I was an undergrad, having newly read SICP, I start to write my own lisp in.... drumroll... matlab!!! I actually made quite a bit of progress before giving up. Ah, to be young again!
Here is one implementation of a lisp (mal specifically) in matlab: https://github.com/kanaka/mal/blob/dcf8f4d7b9cf7b858850a04a0... Only 260 lines of code, pretty concise :)
If you want to learn languages, implementing a lisp interpreter is a great exercise, and lots of fun too. Every time I come across a new language I want to give a try, creating a lisp interpreter is one of the first things I do. 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…
I agree about MAL (which I also came across thanks to HN). I've seen comments on HN to the effect that you are better off looking at the source code of an open lisp to understand how to do it properly, but I found working through MAL really educational and motivating. I was really pleased when I got my MAL implementation (in C#) to self-host. I only really cheated once (by looking at an existing implementation) and t…