3 ms·
Is there a guide like this that uses Golang instead of C?
by spraak 8y ago
Is there a guide like this that uses Golang instead of C?
- phoe-krk 8y agoYou could try MAL (Make A Lisp) - it has a go version. https://github.com/kanaka/mal/tree/master/go https://github.com/kanaka/mal/tree/master/go
- phamilton 8y agoI highly recommend MAL. It does a great job introducing these concepts.
- schoen 8y agoAnother way to describe the MAL concept is that it aspires to be implementation-language agnostic, so that it gives you a series of steps that you're meant to follow regardless of what language you're writing your interpreter in. So the fact that someone else has (or hasn't) already succeeded in doing it in language X needn't affect your ability to do it yourself with language X. I worked through most of MAL with Python and am currently doing it in Haskell. It's a great experience! (I think a few of the concepts could be explained in more detail, though. Maybe I should send in a patch.)
- eigenspace 8y agoMAL is great!
- AlexeyBrin 8y agoWriting an interpreter in Go https://www.amazon.com/Writing-Interpreter-Go-Thorsten-Ball/dp/300055808X https://www.amazon.com/Writing-Interpreter-Go-Thorsten-Ball/... is pretty good. The book assumes that you know Go and the resulting interpreter is not a Lisp.
- UncleEntity 8y agoI've been thumbing through that every so often (as is, presumably, the person who stole the package off my doorstep the first time they shipped it) and it's easy enough to follow without having ever written a single line in go. Though I would suggest reading other sources on how pratt parsers work if you want to fully understand the pure simple genius behind them.
- stevekemp 8y agoI had fun extending the sample language to add new features https://github.com/skx/monkey/ https://github.com/skx/monkey/ though so far I've still not read the book.