Hacker News new | past | comments | ask | show | jobs | submit login

Is there a guide like this that uses Golang instead of C?

You could try MAL (Make A Lisp) - it has a go version.


Another 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.)

I highly recommend MAL. It does a great job introducing these concepts.

MAL is great!

Writing an interpreter in Go 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.

I had fun extending the sample language to add new features https://github.com/skx/monkey/ though so far I've still not read the book.

I'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.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact