3 ms·
re: common lisp shines at low-level tasks like microcontroller programming While I couldn't find an explicit declaration of this in the linked article, the tun
by v9v 1y ago
re: common lisp shines at low-level tasks like microcontroller programming
While I couldn't find an explicit declaration of this in the linked article, the tunnel system likely has something on the level of an SBC (think raspberry pi) rather than a microcontroller. Common Lisp makes it possible to do fun low-level assembly stuff but AFAIK none of the implementations can run on a microcontroller.
There's uLisp, which builds on Arduino's libraries but it isn't a Common Lisp implementation.
In terms of bare-metal CL implementations there is Movitz (stopped development) and Mezzano, but I don't think those can run on any microcontrollers.
There are also some libraries to convert CL to C, thinlisp and CLiCC, but these aren't actively maintained currently.
The possibility of porting Clozure CL to the RP2040 was discussed in the ccl mailing list last year, but I don't think anyone's working on it.
- praptak 1y agoIt probably doesn't make sense to cram a whole Lisp into a constrained environment like a microcontroller. What some people do instead is define a smaller Lisp which acts as a DSL and is compiled to run on the constrained platform. https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp is an example of this approach. "GOAL does not run in an interpreter, but instead is compiled directly into PlayStation 2 machine code to execute. It offers limited facilities for garbage collection, relying extensively on runtime support. It offers dynamic memory allocation primitives designed to make it well-suited to running in constant memory on a video game console. GOAL has extensive support for inlined assembly language code using a special rlet form, allowing programs to freely mix assembly and higher-level constructs within one function."
- Jach 1y agoYeah it's good to call that out. If the author used the term embedded systems there'd be less room for disagreement, as there is a pretty wide spectrum there -- obviously a RasPi that can run Linux is more than enough as far as hardware goes. I also don't think you'll find any CL implementation running out of the box on a $5 ESP32 like you can do with uLisp, but if you hooked up external memory perhaps you could get something going. A fullblown Common Lisp can (with work/money) be made to run in environments probably a lot smaller than most people think... The famous Remote Agent on the DS1 spacecraft was a 4 MB executable and peaked at "32 Mbytes", 20 avg, of memory. (Skimming the linked article, I do see it mentioned that using LispWorks let them run on ARM32 with "128 Mb of RAM". (Presumably that is megabytes.) IIRC that's beyond what you can add to an ESP32. I wonder if they could have gotten away with ECL though, as it has optional and runtime configurable memory limits with a default heap limit of 256 MB.) Though as the sibling mentioned there are other approaches. Here's a fun article on using CL to write an NES 6502 assembler https://ahefner.livejournal.com/20528.html https://ahefner.livejournal.com/20528.html and demo application: https://www.youtube.com/watch?v=T8qEOG2KUQU https://www.youtube.com/watch?v=T8qEOG2KUQU
- varjag 1y agoWhile I couldn't find an explicit declaration of this in the linked article, the tunnel system likely has something on the level of an SBC (think raspberry pi) rather than a microcontroller. I'm the author of that article. It runs on a SOM which is quite downspec from RPi (single core, arm32, 128Mb RAM) but yes it's a full featured system rather than a microcontroller.
- vindarel 1y agoI also hear "programmable chips", does that count? Example: - [Barefoot Networks](https://www.barefootnetworks.com/ https://www.barefootnetworks.com/) - "we use Lisp (via Allegro CL’s Enterprise class development environment) in the design of our Intel Tofino series of programmable switch chips" - article on [Franz Inc networks](https://allegrograph.com/press_room/barefoot-networks-uses-franzs-allegro-cl-to-drive-artificial-intelligence-in-networks/), some words [on reddit](https://www.reddit.com/r/lisp/comments/oq884e/how_do_you_use_lisp_at_work/h6d8xcw/), and a [youtube video](https://www.reddit.com/r/lisp/comments/oq884e/how_do_you_use_lisp_at_work/h6d8xcw/).
- Jach 1y agoLisp applications still are used behind the scenes for a lot of interesting stuff. In 1987, "An advanced VSLI design and simulation suite, with programmability and a GUI, used to design actual taped out processors."[0] Screenshots in "The Symbolics Ivory Design and Verification Strategy": https://archive.org/details/ivory-design-verification/mode/1up https://archive.org/details/ivory-design-verification/mode/1... [0] Thanks to stylewarning for the link last year: https://x.com/stylewarning/status/1834996048307388889 https://x.com/stylewarning/status/1834996048307388889