The Future of Lisp


#1

Yes I’ve learned how much clickbait titles work since I spend a lot of time watching youtube videos.
And I also gave a talk in 1990 in England titled The Future of Common Lisp, in which I was criticized for my click bait title before there was click bait. Because my talk was about a multiprocessor Common Lisp I created in which a key feature was using the Future object which I stole from Halstead’s Scheme.

My company Top Level, Inc commercialized and ported to different multiprocessors a multiprocessor Common Lisp I originally implemented at UMass. Futures were values that would appears once their computation was completed. If you tried to use them before they were done, you would wait for them.
So all synchronization was implicit. This was possible because Lisp is a dynamically typed language. When you add two things, it checks what kind of things you are adding. If one of those things was a future, check if its value is currently available or not. It seems this idea was not that useful in practice.
Paul Graham gave a cute quote “The difference between theory and practice is bigger in practice than in theory” which I quote here because I stopped using Lisp for about 20 years now, when it was a huge part of my life. After I left Franz Inc in 2001 to start a business building online store websites using a Lisp based system with its own object database and dialect of Lisp. It failed, perhaps because the internet boom crashed, but that was the end of Lisp. I went on to design wireless internet equipment, which was all Linux based and C code. Forward to today, I use arduino and build little hardware things, this time I am building a new version of my lap timing system and race management for r/c car racing. And the last few days I worked on a big outdoor display of digits that sits near the finish line and can show you laptimes as you pass, as well as other race functions.

The old system used “big” 7-segment numbers, but this time the idea was using a “big” tv/monitor screen, since an old 50in lcd TV is essentially free today. You can drive these via HDMI using a $10 raspberry pi.
But I didn’t need 50in for this and I had a few 22in monitors and they use vga inputs. So i found BitLuni’s arduino library that could drive a vga with a esp32 directly, and I mean directly…attaching vga pins right to the esp32 and that’s it. Awesome. However, I discovered it really only worked at 320x240 even though it had 640x480 and even 800x600 because it ran out of memory. Well I really only need 4 colors (i.e. 2 bits), or even 1 color if I had to, and not 8 bits. So being its open source, I figured I’d modify it to do this.
This leads me here (though I don’t remember how exactly), because the code for BitLuni’s library is all in C++, and I was reminded why I hate C++ and the days when I wrote articles on how bad it was vs CommonLisp.

Ok, too long already, and I must post this before something crashes and I lose it all…


#2

The Arduino system/IDE is terrible, but when you are writing really small simple programs, it works.
The ATMega328 at 16mhz with 32k of flash and 2k of memory, how big an app can you really have?
Actually quite a lot, I converted my 1961 Loader/Backhoe to EFI using a msp430 with similiar specs.
But now the ESP32 runs at 240 Mhz and 8mb of flash, and 512k of memory (and can have 2mb)
That can run a full on app. CNC machines are now running esp32 with full set of features, At a cost of $3.

What language are used for these apps? Well its C/C++. And well there are many others too, but Lisp isn’t really one of them. I think Javascript is the most popular language, and for good reasons, it is very Lispy with a C kinda of syntax, but more importantly it is universally available in the web browser.

What would it take to get Lisp being used again? “arduino C” is quite sufficient in my view for most of what I’ve done, and my ATTINY202 with 2k of flash and 128 bytes of memory could not even run Arduino/C, I had to code a uart directly instead of using the Serial library. However, a lisp could compile into machine code to run on an attiny202…right? And then also run on an esp32 with a real object system. and run “scripts” to handle stuff like arduino does with python? Yes we know it can because the Symbolics Lisp Machine did it.


#3

Let’s think about a Lisp that is a completely 180 opposite of Lisp. It has no lists, no dynamic typing.
Every value is an integer. So a like “C” language where the only type is “int”.
You want a string, ok, an integer can be interpreted as a character, an array of integers can be a string.
Wait did I say array, what array, we only have ints.
An array is just an integer interpreted as a base address with an offset.
We just need a function that does a lookup with a base address and offset.
Let’s call it aref (aref int int) -> int

Now you really must have macros, lisp without them just isn’t lisp. The power of lisp is creating new languages that are appropriate to your requirements. And having the language itself as lists and symbols
allows you to create code easily and simply. And of course backquote the great syntactic sugar to get a high.
So this integerLisp needs macros too, and what is a symbol, just an integer, what is a list, it is just an integer.
How about we just call this new lisp language “Zero” ? Or maybe “One” as it has just one type.

The Common Lisp I created was implemented in a lisp like assembly language. The compiler generated this lisp assembly. It made the whole system very easy to port to different machines. There was the assembler which compiled this lisp assembly into machine code for the target machine.