Old LISP Language Used for New Raspberry Pi OS

On the scale of awesomeness, writing an operating system ranks near the top for software hackers and ranks just below writing a whole new language. [Lukas F. Hartmann] is reaching for the epic status with the Raspberry Pi operating system dubbed Interim. In an interesting mixture of old and new, it’s written in LISP!

LISP (LISt Processing) is the second oldest high-level programming language that received wide-spread usage. The only one older is FORTRAN (FORMula TRANslation), and that is just by one year. LISP is generally associated with artificial intelligence research but it also surfaced as a utilitarian scripting language in various applications like AutoCad. You may have also heard of a more recent dialect, Clojure, which has been receiving a lot of attention.

lisp-raspberry-pi-2-thumbThe source code, an image for the Pi 2, and directions for making it all work are available. [Lukas] also describes how to get a new OS up and running on a Pi.

[Lukas] isn’t the first to create this type of system. Back in the ’70s MIT worked on a Lisp machine that led to commercially available systems. If you have an old Apple IIe around you can make it into a Lisp Machine. You can also find LISP in the Internet of Things. And then there is [kremlint] who actually scored an original LISP Machine. We’ll have to keep an eye on his progress in restoring it to working condition.

Thanks for the tip, [krs013].

Another Internet of Things Board (But This One Has Lisp)

Using routers as dev boards has been a long and cherished tradition in the circles we frequent, and finally design houses in China are taking notice. There have been a few ‘Internet of Things’ boards in recent months that have taken the SoC found in low-end routers, packaged the on a board with USB, some GPIOs, and a fair bit of memory and called it a dev board. The ZERO Plus is not an exception to this trend, but it does include a very interesting feature when it comes to the development environment: this one uses Lisp as its native language.

The Zero Plus is pretty much what you would expect from a router SoC being transplanted to an Internet of Things board: it uses the Ralink RT5350 SoC, giving it 802.11b/g/n, has 32MB of RAM, 8 or 16 M of Flash, I2C, I2S, SPI, USB, two UARTs, and 14 GPIOs. There is support for a webcam, temperature and humidity sensor, displays, and Arduino via a breakout board that appears to contain a standard, DIP-sized ATMega328,

All of that could be found in dozens of other boards, though. What really sets this one apart is the Lisp development environment. Programming the Zero is exactly as elegant as you would expect, with a ‘toggle a LED according to what time it is’ program looking something like this:

(define LED_On (lambda ()(dev.gpio 11 “out” 1)))
(define LED_Off (lambda ()(dev.gpio 11 “out” 0)))
(define CurrentTime? (lambda ()
(int (time.strftime “%H” (time.localtime (time.time))))))
(define Night?
(lambda ()
(> ( CurrentTime? ) 16) (< ( CurrentTime? ) 23)
(if (Night?) (LED_On) (LED_Off)

Dev boards built around somewhat more esoteric programming language isn’t anything new; The Espruino brings Javascript to ARM microcontrollers, and the MicroPython project is an astonishing undertaking and successful Kickstarter that brings the BASIC for the 21st century to the embedded world. Lisp, though… I don’t think anyone expected that. It’s a great way to differentiate your product, though.

The Apple IIe Becomes a Lisp Machine

Way back in the late 1970s and early 1980s, a few very awesome people around MIT were working on Lisp machines. These computers were designed specifically to run Lisp as their main programming language. Around the same time, a few [Steves] in California were working on the Apple II, which would soon become one of the most popular computers of all time. The Apple II ran BASIC as its main programming language, fine for the time, but surely not as elegant as Lisp. It took more than 30 years, but [Alex] and [Martin] figured out a way to turn the lowly Apple IIe into a Lisp machine.

Developing Lisp for the Apple IIe was surprisingly easy for these guys – they simply wrote a Lisp interpreter in C and used a 6502 compiler to generate some machine code. The main problem of porting Lisp to an Apple II was simply getting the code onto the Apple. We’re assuming this would have been easier had the same project been attempted in the 80s.

To get their interpreter onto the Apple, they used the very awesome ADTPro library that allows data to be loaded onto an Apple II via the cassette port and a modern computer’s microphone and speaker jack. After a solid minute of loading analog data onto this digital dinosaur, [Alex] and [Martin] had a Lisp interpreter running on ancient yet elegant hardware.

The source for the 6502 Lisp interpreter can be found on the GitHub along with all the necessary tools to load it via a modern computer. That’ll give you all the ancient lambdas and parens you could ever want. One warning, though: backspace doesn’t exactly work, so be prepared for a lot of frustration.

You can check out the demo video below.

Continue reading “The Apple IIe Becomes a Lisp Machine”

Generating G-code with Common Lisp


Ruin & Wesen are a two person shop creating specialized music gear. As part of their recent MIDI Command development, they got into case manufacturing. They purchased a mini CNC mill to cut the aluminum cases. Unhappy with the software options provide [Wesen] decided to write his own G-code generator. G-code is part of the numerical control used to command CNC machines. He implemented his interpreter using the language he’s most familiar with: Common Lisp (not surprising if you notice the website’s backend). The post covers the design philosophy used and some of the problems that came up. We look forward to future releases since the interpreter can generate milling code using processing.org sketches and cut PCBs directly from Eagle.

You may remember Ruin & Wesen from when they shared their Eagle layout videos.

[Thanks fbz]