114 points · by mepian · 8y ago · 74 comments
I envision something like a Raspberry Pi, but with the hardware designed to run Lisp, and taking inspiration from the original Lisp Machines.
Actually some the first ARM processors were supposed to run a Lisp operating system. When Apple did the research&development for the Apple Newton, they originally attempted to run a Lisp-like system on mobile systems like PDAs and tablets. This Lisp dialect was derived mostly from Scheme and Common Lisp - the language was eventually called Dylan. Apple had ARM systems in their lab which ran a Dylan OS. When they at one point chose the ARM processor, Apple invested in ARM and they used a chip which was able to support a garbage collected language. Unfortunately these Lisp operating systems by Apple did not reach the market and Apple instead sold the Apple Newton with an OS kernel written in C++ and the software on top written and scripted in NewtonScript - a language with many aspects from Lisp - incl. garbage collection.
For a recent attempt see: https://github.com/froggey/Mezzano
(Only half joking)
My understanding is that the tooling available on lisp machines was so good it made emacs look rigid and dumb. I'd imagine that reacreating such tooling would take more man hours that building the lisp machine and its kernel but I don't know.
The software wasn't dumb, there was just a lot less of it. They didn't have IPv6, SSL, a web browser ...
One halfway house would be a Lisp unikernel.
But an operating system built around the idea could be quite interesting. From what I know, the systems running on the Lisp machines of the 1980s were nightmares from a modern security perspective. But the idea of having a closely integrated development-runtime-environment centered around Lisp is appealing, I think.
Except that building an OS from scratch is a lot of work, at least if you want to support a reasonable range of hardware. But maybe you do not even need that. Now that I think of it, one might build a desktop environment for a modern Unix-ish system that aims to reproduce the Lisp machine development environment of the olden days. This would also allow one to harness the existing Lisp implementations. Does anyone know of such a project?
Unfortunately, it seems to have been based around PicoLisp, which isn't exactly a popular Lisp implementation.
I expect that for any project like this to get wide traction in the Lisp community, it would have to be based around Common Lisp, as that's by far the most popular Lisp out there, with a huge existing ecosystem it could leverage -- an advantage akin to basing the Raspberry Pi around Java.
I sometimes try to imagine a world where these things took off, but the closest thing I've touched is Emacs and I'm pretty sure that's not what they had in mind.
It's another subject, but I think there's a bit of a Stallman-esque glorification of LMI when they never seemed to go anywhere nor were Lambda machines that appealing IMHO.
TI bought/licensed the technology from LMI and then developed a bunch of interesting machines, like: Lisp Machines with embedded Unix system running on its own 68020 and communicating via a 68010, the first commercial Lisp Microprocessor (a 32bit chip), compact Lisp workstations using that chip, a NuBUS board for the Mac II based on their Lisp chip, ...
Upshot: you can probably get away with it if you are careful to canonicalize pointers before using them.
Is lisp relevant if the whole world move deep learning AI with self programming is the norm. May be. But a hardware?
Symbolic AI of the sort for which Lisp Machines were originally created is still extremely important as something is needed to provide “executive function” in intelligent systems.
Software is always a big concern and rather than requiring everything be written in Lisp, I'd want to also be able to run regular binaries written in C. This requires a way to safely embed the "impure" world.
The obvious way to do this is extend the value domain with a hidden tag bit [3] which is carried around everywhere, but can't be changed or inspected by regular RISC-V instructions and in fact, almost all instructions trap if any operand is tagged.
Memory space would be partitioned into a tagged space and untagged. Tagged values can only live in the tagged space and registers (this is important for precise GC). For regular user space code, tagged values can only be created with a `cons` instruction, and accessed with `car`, `replaca`, etc instructions. Having dedicated instructions would allow a hardware read barrier for real-time (or incremental) GC. (Machine mode would be allowed unsafe access for part of the GC and various tasks).
TL;DR: adding fast Lisp support to an existing RISC-V core is likely much easier than building a new dedicated architecture from scratch.
(set! projects (cons 'RISCV-LISP projects))
[1] https://github.com/tommythorn/lisp [2] https://github.com/tommythorn/yarvi [3] If you have data cache, it's not hard to implement a cache line as, say, 32 33-bit word line, backed by 33 32-bit memory words.
Ah, back in those times it was already an argument.
Hey now.