Hacker News new | ask | show | jobs
by sassy_samurai 3199 days ago
There is a similar project called "Build Your Own Lisp"[0] (BYOL), which is a book that walks one through making a Lisp in C. Has anybody here done BYOL? How does it compare to MAL? If you had to choose one to learn how to create a Lisp, which would you choose?

[0]: http://www.buildyourownlisp.com/

4 comments

BYOL is targeted at implementing Lisp in C and focuses on learning C. There is a fair bit more hand-holding and example code in C for most of the steps than in the mal guide. BYOL is more polished and written in the form of a short book whereas the mal guide intentionally tries to be more concise and informal in style. I would read through the first couple of sections of both and decide based on your own goals and preferences.
Actually you might like stage0 http://git.savannah.nongnu.org/cgit/stage0.git/ It literally goes from a 280byte hex monitor all the way through a compacting garbage collected lisp and FORTH

Without the assumption that any other software exists

I used build your own lisp to learn C (along with other stuff) I liked it, except I dont think its the best way to learn to develop languages.
I looked at BYOL a while ago, but was turned off by the fact that the author wants you to use his parser. I don't know why, but I didn't like that. I feel like there's value in using a pre-existing, widely-used parser like yacc/lex, for no other reason than that it already exist and is widely used.
Oh man, that's a bummer. I think one of the great joys in constructing your own compiler or interpreter is making your own lexer and parser. Doesn't using a pre-made lexer/parser kind of defeat the purpose of making your own compiler/interpreter?