LISP is a polarizing language. Either you love it or you hate it. But we’ll put aside our personal preferences to bring you a good hack. In this case a LISP environment running on an ESP8266. [Dmitry] is on the “love it” side of the fence — he’s been waiting for an excuse to code up a LISP interpreter for a while, and he found one in the ESP8266.
One weekend bled into the next, but he got the system running, connected to the network, and had LEDs blinking! In the end, he even managed to squeeze in some optimization for memory’s sake. Pretty cool, and because it takes advantage of an already complete system, it can even be made pretty useful. Not bad for a few weekends’ work!
And finally, if Lots of Irritating Silly Parentheses is your idea of a good time, but the wealth of computing resources available on an ESP8266 seem overkill, have a look at Microlisp, running on an AVR. Or go to the opposite extreme, and run a LISP OS on a Raspberry Pi. Whatever you do, don’t forget to close your parentheses! (We’re told that’s a traditional LISPer farewell.)
We’ve seen tiny microcontroller-based computers before, but nothing like this. Where the usual AVR + display + serial connection features BASIC, Forth, or another forgotten language from the annals of computer history, this project turns an AVR into a Lisp machine.
The μλ project is the product of several decades of playing with Lisp on the university mainframe, finding a Lisp interpreter for the 6800 in Byte, and writing a few lisp applications using the Macintosh Toolbox. While this experience gave the author a handle on Lisp running on memory-constrained systems, MicroLisp is running on an ATMega328 with 32k of Flash and 2k of RAM. In that tiny space, this tiny computer can blink a few boards, write to an OLED display, and read a PS/2 keyboard.
The circuit is simple enough to fit on a breadboard, but the real trick here is the firmware. A large subset of Lisp is supported, as is analog and digitalRead, analog and digitalWrite, I2C, SPI, and a serial interface. It’s an amazing piece of work that’s just begging to be slapped together on a piece of perfboard, if only to have a pocket-sized Lisp machine.
Thanks [gir] for the tip.
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.
The 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].
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))))))
(> ( CurrentTime? ) 16) (< ( CurrentTime? ) 23)
(if (Night?) (LED_On) (LED_Off)
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”
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.