6 ms·
Self-hosting Lisp-to-C compiler in 384 lines of Lisp
- abecedarius 16y agoCompared to other recent Lisp posts, this one implements the nitty-gritty like garbage collection itself, not depending so much on the implementation language.
- Semiapies 16y agoIs there a problem around lines 87 or 88? Or is it just with the syntax highlighting? ETA: Thanks!
- abecedarius 16y agoSyntax highlighting. Github thinks it's Scheme when it's really its own dialect of Lisp, with \c for a character literal instead of #\c. (Part of the fanatical simplification.)
- sedachv 16y agojust the highlighting... it doesn't understand the \" escape
- deleted 16y ago[deleted]
- sedachv 16y agoIf you think that's cool, check out Darius' old site: http://www.accesscom.com/~darius/ http://www.accesscom.com/~darius/ He's a pretty prolific hacker.
- thomaz 16y ago"Lisp compiler in (arbitrary language) in (arbitrary number lines." Why not just metaprogram this?
- silentbicycle 16y agoMetaprogramming isn't free. Trivial conversion from lang A to lang B, even less so. I dare you to write a program that compiles arbitrary Java code to awk. They're both Turing-complete, so it's guaranteed to be possible! Cheers!
- silentbicycle 16y agoPS, "ichbins" = "I can hardly believe it's not Scheme!". For a while I thought it was [["Ich bin"s]], => "I AM"s auf deutsch. Good to see abecedarius is finally un-dead'd.
- abecedarius 16y ago"Ich bins" with the 's' actually does mean "It's me" in German (I'm told). Manuel Simoni pointed out the pun when he saw an earlier attempt called 'icbins'.
- konad 16y agoBrucee used to assign "Lisp in C" and "C in Lisp" when he was teaching. when he wasn't messing with people : http://en.wikipedia.org/wiki/Mark_V_Shaney http://en.wikipedia.org/wiki/Mark_V_Shaney