5 ms·
Llisp: Lisp in Lisp
- sillysaurusx 5y agoHappy to see Bel affect language design. There are some great (under-studied) ideas in it.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- punnerud 5y ago“ Let’s just cheat and use Clojure’s edn”, a true Lisp in Lisp should be able to do: Lisp in Lisp in Lisp…
- deleted 5y ago[deleted]
- nils-m-holm 5y agoHere you are: http://t3x.org/lfn/ http://t3x.org/lfn/ (Scroll down a bit for links to the code)
- tromp 5y agoMeanwhile, BLC in BLC (binary lambda calculus) takes only 29 bytes: https://www.ioccc.org/2012/tromp/hint.html https://www.ioccc.org/2012/tromp/hint.html
- tosh 5y agoTIL some-fn
- krylon 5y agoWriting a Lisp interpreter an Lisp is cheating. You get the reader and garbage collector for free. Don't get me wrong, it's fun. But if you want to learn about things, writing a Lisp interpreter in some (relatively speaking) low-level language like C/C++ is a much more satisfying experience. And then write a Lisp interpreter to run on your Lisp. Bonus points if you get to optimize tail recursion. (I didn't, but I didn't try to, so I don't consider it a failure.)
- tromp 5y agoNote that the BLC self-interpreter mentioned in another comment does not get the reader for free, having to parse lambda terms (including numbers written in unary) from a stream of bits. It does get a garbage collector for free. It is accompanied by a BLC interpreter written in 25 lines of obfuscated C that does include a reference counting garbage collector.
- capableweb 5y agoWriting a Lisp interpreter in C/C++ is cheating. You get readable code and a standard library for free. Don't get me wrong, it's surely fun, but if you really wanna learn about things, you need to write a Lisp interpreter in Assembly. It's a much more satisfying experience. Jokes aside, I'm hoping the author continues to feel free to spend their time implementing whatever idea they come across that is interesting. Sure, it's not as advanced as implementing something in C/C++, but maybe the authors goal was just to understand their preferred lisp (Clojure) better, rather than trying to understand C/C++ better? > Bonus points if you get to optimize tail recursion. (I didn't, but I didn't try to, so I don't consider it a failure.) Is this as complicated as people put it? I've never implemented my own lisp, but MAL (https://github.com/kanaka/mal https://github.com/kanaka/mal) makes it seem like a relatively easy step in the process.
- akkartik 5y agoYou joke, but.. https://github.com/akkartik/mu/tree/main/shell https://github.com/akkartik/mu/tree/main/shell
- samatman 5y agoAh c'mon that's cheating! Real Programmers start with Steele and Sussman's Design of a LISP-based microprocessor, and hit the FPGAs before they so much as write 'cons'!
- pmarreck 5y agoIs there anything I can read in order to discover the general principle in creating a tail-recursion optimizer? I know how to ensure it's triggered, but not necessarily how to write one...
- agumonkey 5y agohis short special form name is reminiscent of early 80s lisp research (lelisp iirc)
- pmarreck 5y agoisn't this everyone's first-year CS homework? or was that just me? ;)
- capableweb 5y ago> isn't this everyone's first-year CS homework? Maybe, but I wager most people who work with computers didn't even go for a CS degree.