4 ms·
"Implementing a language that resembles Scheme is quite easy. Implementing call-with-current-continuation and hygienic macros AND getting the tricky little deta
by plinkplonk 8y ago
"Implementing a language that resembles Scheme is quite easy. Implementing call-with-current-continuation and hygienic macros AND getting the tricky little details correct is not."
(tangential) and this is where most "build your own compiler" style books fall down.
They teach you to implement ultra simple languages, but don't tackle memory management/garbage collection, concurrency, production grade typecheckers, and for lisplikes, macro systems, etc.
- nils-m-holm 8y ago> (tangential) and this is where most "build your own compiler" style books fall down. Have a look at http://t3x.org/s9book http://t3x.org/s9book - it covers a Scheme implementation including GC, call/cc, low-level macros, type checking, tail call elimination, etc.
- eatonphil 8y agoYou will love Lisp in Small Pieces [0] then. :) It covers various lisps (mostly Scheme and Common Lisp) including how continuations can be implemented. Hygienic macros are not hard to implement [1]. I can't speak to the efficiency of my implementation though. [0] https://www.goodreads.com/book/show/1168500.LISP_in_Small_Pieces https://www.goodreads.com/book/show/1168500.LISP_in_Small_Pi... [1] https://github.com/eatonphil/bsdscheme/blob/master/examples/ellipsis-syntax.scm https://github.com/eatonphil/bsdscheme/blob/master/examples/...