Live data from Hacker News

Little Lisp interpreter

hackerschool.com

11–20 of 49 posts

Re: Little Lisp interpreter

#11
Who needs a toy lisp? Can't we just lisp for real?

Edit: Ok, ok. Now that the title of submission has been changed from "Toy Lisp Interpreter" to "Little Lisp Interpreter" my quip, having lost context doesn't make me smile anymore either.

Re: Little Lisp interpreter

#12

I've written a toy Lisp interpreter that eventually evolved into a toy Lisp compiler. It's a gratifying exercise that I'd recommend for every programmer.

Likewise - I did this as part of a hackathon earlier this year - thoroughly enjoyed seeing how all the pieces fitted together.

Re: Little Lisp interpreter

#13
post #4

If you find that interesting, you should probably take a look at this: http://michaux.ca/articles/scheme-from-scratch-introduction I had fun following along with him. Now, if he (or I can get my shot at it finished) can ever finish working on the byte-code based version!

You might enjoy Lisp in Small Pieces. Is one of my favorite books

The book is in two parts. The first starts from a simple evaluation function and enriches it with multiple name spaces, continuations and side-effects with commented variants, while at the same time the language used to define these features is reduced to a simple lambda-calculus.

The second part focuses more on implementation techniques and discusses precompilation for fast interpretation: threaded code or bytecode; compilation towards C. Some extensions are also described such as dynamic evaluation, reflection, macros and objects.

http://www.amazon.com/books/dp/0521545668

Re: Little Lisp interpreter

#16

I've written a toy Lisp interpreter that eventually evolved into a toy Lisp compiler. It's a gratifying exercise that I'd recommend for every programmer.

I couldn't agree more. Writing my own interpreter https://github.com/cninja/pEigthP provided many challenges but I think it was one of the most enjoyable "toy projects" that I have done. Also seeing the look on someones face when I say I wrote something to allow me to embed lisp into PHP is priceless.

Re: Little Lisp interpreter

#17
post #4

If you find that interesting, you should probably take a look at this: http://michaux.ca/articles/scheme-from-scratch-introduction I had fun following along with him. Now, if he (or I can get my shot at it finished) can ever finish working on the byte-code based version!

Looks very interesting; I already had a shot at implementing a subset of scheme using F# (https://github.com/fabriceleal/Pang), it would be very interesting to follow this series and check the differences between my and his implementations.

I would also find very interesting to see a step-by-step series on compiling scheme (with macros included) using llvm. I never tried really hard to look for one, though.

Re: Little Lisp interpreter

#19
post #4

If you find that interesting, you should probably take a look at this: http://michaux.ca/articles/scheme-from-scratch-introduction I had fun following along with him. Now, if he (or I can get my shot at it finished) can ever finish working on the byte-code based version!

You might enjoy Lisp in Small Pieces. Is one of my favorite books The book is in two parts. The first starts from a simple evaluation function and enriches it with multiple name spaces, continuations and side-effects with commented variants, while at the same time the language used to define these features is reduced to a simple lambda-calculus. The second part focuses more on implementation techniques and discusses…

Great book, although I found it hard parse sometimes (compared to say the later chapters of SICP) which I suspect is because it is translated from french. Either way, it puts so much information in one place, it is incredibly valuable.

Re: Little Lisp interpreter

#20
post #4

If you find that interesting, you should probably take a look at this: http://michaux.ca/articles/scheme-from-scratch-introduction I had fun following along with him. Now, if he (or I can get my shot at it finished) can ever finish working on the byte-code based version!

Really loved the sense of community that sprouted up around those articles :) I remember everyone following each other's projects on github, and the discussions in the comments on the blog posts. Good memories :)

I should finish my Ada version sometime... Or just start a new project haha

Post reply on HN