3 ms·
Is there a kind of walkthrough/tutorial about how to develop a little Lisp interpreter? That sounds like a fun experiment. PS: Sorry, I am a Java OO developpe
by lolive 10y ago
Is there a kind of walkthrough/tutorial about how to develop a little Lisp interpreter?
That sounds like a fun experiment.
PS: Sorry, I am a Java OO developper. But I like to learn :)
- kriro 10y agoThere's this classic by Peter Norvig (of AI a Modern Approach fame) about wrting a Lisp in Python...which also happens to have an amazing title :D http://norvig.com/lispy.html http://norvig.com/lispy.html Edit: He also links to his Scheme interpreter in Java in that article: http://norvig.com/jscheme.html http://norvig.com/jscheme.html
- kornakiewicz 10y agoFor example: http://www.buildyourownlisp.com/ http://www.buildyourownlisp.com/ But there's plenty more.
- agumonkey 10y agoAnother one https://github.com/kanaka/mal https://github.com/kanaka/mal (quite famous AFAIK)
- coldtea 10y ago>Is there a kind of walkthrough/tutorial about how to develop a little Lisp interpreter? At least as many as there are TODO app examples for web frameworks...
- pjmlp 10y agoYes, this quite good book, "Lisp in Small Pieces" https://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/dp/0521545668/ref=pd_rhf_dp_s_cp_3?_encoding=UTF8&pd_rd_i=0521545668&pd_rd_r=YM5VENWTAZJVESD5NFR3&pd_rd_w=oRQlB&pd_rd_wg=s7HjI&psc=1&refRID=YM5VENWTAZJVESD5NFR3 https://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/...
- wolfgang42 10y agoWhat I did was follow Paul Graham's Roots of Lisp[1]. He lays out in simple terms the basic operations, all I did was copy his examples into unit tests and then write code until the tests passed. I didn't even bother writing a parser, I just used JS expressions like this: [natives.label, factorial, [natives.lambda, [n], [natives.cond, [ [natives.eq, n, 0], 1 ], [ true, [natives.times, n, [factorial, [natives.plus, n, -1]]] ] ]] ] It took me about 5 hours to get the whole think working from his paper, and I learned a lot in the process.
- yosbelms 10y agoI've made a Lisp that compiles to Ramda.js, the source code is simple, http://github.com/yosbelms/ramdascript http://github.com/yosbelms/ramdascript
- amyjess 10y agohttps://danthedev.com/2015/09/09/lisp-in-your-language https://danthedev.com/2015/09/09/lisp-in-your-language A Lisp implemented through JavaScript arrays.