by kingkongjaffa · 2y ago · 0 comments
Is there a learning resource that covers exactly this for those wanting to write software in lisp in 2024?
As "first principle thinkers" in some ways all hackers crave for that "fundamental building blocks approach", a bit like wanting to know how we go from transistors to full computers and every step along the way. Most of us have made peace with accepting the many abstractions because we're slinging highly abstracted mostly python, and javascript code at startups.
So learning Lisp seems like a nice digestible point to start from along the continuum if indeed there's some eloquent way to learn: >only needs 5 keywords and 8 syntactic forms.
and then be off to the races, so to speak.
The style of the Little/Seasoned/Reasoned Schemer is a little different from the other books I highlighted here, but various people have said they really like it, including Guy Steele, so they may be worth a look if the others don't really work for you.
*: <https://mitp-content-server.mit.edu/books/content/sectbyfn/b...>
**: <https://gustavus.edu/academics/departments/mathematics-compu...>
"An Incremental Approach to Compiler Construction"
http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
You will get you own compile to native code Scheme compiler, and then take it from there.
Don't care about performance, only the learning experience.
In the same vein, it is also fun to have a look at church-encoding in lambda calculus and to play with it in the language you choose.
I'm not sure what a syntactic form means here - dot as in dotted pair, nil, quote, quasiquote, parens? Having trouble coming up with 8 distinct syntactic things.
The basis set underlying lisp is something like the lambda calculus with optional delayed evaluation, a product type and some file I/O.
The optimal basis set for computation is either non-unique or not yet discovered as far as I can tell - different people arrive at different combinations.
If one adds a requirement of additively optimal program length as in [1], then Binary Lambda Calculus is a good candidate.
[1] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...
So I built my own Lisp machine based on the nand2tetris architecture, with lisp instructions supported on the simulated chip level. I'm currently in the progress of doing a writeup of the project, you can see my attempts here if you are interested: https://deosjr.github.io/
I have an almost working version of a REPL running on the machine now, including garbage collection and parsing Lisp with Lisp and passing the output to an eval function written in assembly (the operating system, if you will).
Not the most efficient approach but it does work.
This approach can be reasonably efficient for implementing Haskell, as shown in [1] and the much more concise [2].