[HN Gopher] Lisp in 99 lines of C and how to write one yourself ... ___________________________________________________________________ Lisp in 99 lines of C and how to write one yourself [pdf] Author : jstanley Score : 104 points Date : 2022-07-14 18:52 UTC (4 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | jayd16 wrote: | How many lines of Lisp is C? | xedrac wrote: | A lot more than the number of lines of Lisp in Lisp. | bdamm wrote: | Are you proposing writing a replacement for gcc in lisp? If | the goal is to have executable machine code then the turtles | must end somewhere. | dang wrote: | We changed the URL from https://raw.githubusercontent.com/Robert- | van-Engelen/tinylis... to one that doesn't auto-download the pdf. | | The project page is https://github.com/Robert-van- | Engelen/tinylisp/. | lioeters wrote: | In a similar line as the posted project TinyLisp, I'd like to | mention uLisp. | | Lisp for microcontrollers - Arduino, Adafruit M0/M4, Micro:bit, | ESP8266/32, RISC-V, and Teensy 4.x boards - http://www.ulisp.com/ | | In particular, its smallest variant (~800 LoC). | | > uLisp Zero is a pared-down version of uLisp, capable of running | in 8 Kbytes of program memory with 1 Kbyte of RAM | | https://github.com/technoblogy/ulisp-zero/blob/master/uLispZ... | | --- | | And I can't help but mention Make-a-Lisp and its C implementation | (~350 lines). | | https://github.com/kanaka/mal/blob/master/impls/c/stepA_mal.... | latenightcoding wrote: | When I did something similar the hard part was implementing | continuations efficiently, a feature that a lot of these small | lisp interpreters lack. | timmg wrote: | Any pointer to how that's done (in the context of an "easy" | interpreter like this)? | deanmen wrote: | Trampolines | kitd wrote: | Funnily enough, I've been writing my own Lisp in C recently. | Interesting to see how it is done by someone skilled. The boxing | of expression pointers into a single float is really cool. | [deleted] | GartzenDeHaes wrote: | "CMC Threat Intelligence" flags that PDF as malicious. | | https://www.virustotal.com/gui/url/081fd12ade3ff10b2812f630f... | kitd wrote: | Weird. 1 out of 87 vendors. I wonder what they found that | others didn't. | nominusllc wrote: | Anybody have an image or text copy? | WJW wrote: | Would be kinda cool if they just spotted that it contained a | full LISP interpreter and assumed from that that it might be | malicious because in some earlier case they came across a | malicious PDF that obscured its payload with a custom LISP | interpreter. | rawoke083600 wrote: | All these "small lisps / lisp-in-go / lisp-to-xyz" are great and | I do applaud the exercise and what is produced, and I also | appreciate many of of these projects are for learning or fun | projects. | | BUT if by chance you or your project is one of the more "serious | lisps or next-lisp-vibes" hear his: | | Before you even think about speed or | benchmarks(size,spec,speed,lang) remember we live in a connected | world that is multi-core. | | First prize for your home-brew lisp that would make me sit up and | take notice is if it has very easy net-libraries built-in (http | (client + server), websocket, sse, json etc) I think that is one | of the things Go(yes I know not every like it, but the real world | usage is real) got right, the std lib was very "modern" at least | to the point of real-world usability. Multicore is a close second | prize :) | | Network-libs (stupid easy ones) and the concurrency concepts is | the very first thing I look for in a lang or lisp-derivatives | | My 2cents :) ___________________________________________________________________ (page generated 2022-07-14 23:00 UTC)