5 ms·
Writing a Lisp to x86-64 compiler
I'm starting to write a series on compiling Lisp to x86-64 and I would appreciate any and all feedback.
Find the first post at https://bernsteinbear.com/blog/compiling-a-lisp-0/
- tekknolagi 6y agoClickable link: https://bernsteinbear.com/blog/compiling-a-lisp-0/ https://bernsteinbear.com/blog/compiling-a-lisp-0/
- rightbyte 6y agoThe raw concept of executing modified memory is neat. It looks so clean and simple.
- tempodox 6y agoThis first post is nicely done. The basics of building a JIT compiler in just a few lines of C, and everything thoroughly explained. Also, the “getting your hands dirty” and “making your own mistakes” approach is how you really learn something.
- tekknolagi 6y agoThanks! I appreciate the feedback.
- tekknolagi 6y agoJust finished the second post this morning if you're interested: https://bernsteinbear.com/blog/compiling-a-lisp-2/ https://bernsteinbear.com/blog/compiling-a-lisp-2/
- z3phyr 6y agoThis is something I was looking forward to! Thanks you so much <3 Do you follow John Carmack's coding standard?
- tekknolagi 6y agoI'm glad you enjoyed! I don't know anything about John Carmack's coding standard, so probably not.
- tekknolagi 6y agoJust finished the second post this morning if you're interested: https://bernsteinbear.com/blog/compiling-a-lisp-2/ https://bernsteinbear.com/blog/compiling-a-lisp-2/
- jart 6y agoYou're missing the forest for the trees. What's the tiniest x86-64 code generator that can bootstrap John McCarthy's meta-circular evaluator, as it is written in his original paper. Now that's something I'd love to see. What he accomplished there is so profound and has served as the center of gravity that's attracted folks to LISP ever since. Also if you build it with APE your distributables will run on all platforms https://justine.storage.googleapis.com/ape.html https://justine.storage.googleapis.com/ape.html
- acqq 6y ago> Also if you build it with APE your distributables will run on all platforms Did anybody show that that format is actually usable for distribution of something that's not expected to be very, very small? I've got an impression it's more a hacking achievement than a really practical solution.
- jart 6y agoUNIX philosophy is to have lots of small executables. This is a brand new scrappy project that offers a lot of value in terms of better enabling that vision. It uses normal GNU C / C++ / FORTRAN (which are all fantastic toys) combined with a linker script that emits a new executable format.
- lioeters 6y agoThank you for that article, it was a joy to read. The lively discussion last week about APE: αcτµαlly pδrταblε εxεcµταblε - https://news.ycombinator.com/item?id=24256883 https://news.ycombinator.com/item?id=24256883
- nils-m-holm 6y ago> What's the tiniest x86-64 code generator that can bootstrap John McCarthy's meta-circular evaluator, as it is written in his original paper. Now that's something I'd love to see. If a C code generator will do, this will be the topic of my upcoming book.
- 6y ago
- scott31 6y agoWhy not Arc to x86-64 compiler?
- tekknolagi 6y agoI don't know anything about Arc. I also want a bit of creative license to change the host language as needed, and people might not appreciate "Arc with Max's edits".