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.
This is really cool. Lisp is an amazing language (especially modern dialects like Common Lisp)
Many of the built in features are only now being ported to other languages.
II’m impressed. Very impressed. The Apple ][e ran Pascal and used the USCD P-System as its file system. However the DUO drive set isn’t supposed to be used like that, the weight of the monitor can damage those floppy disk drives. So I certainly hope it wasn’t used like that.
By the way what does First Comment go for these days?
I had a //e with a DUO and the Apple Color Composite monitor on top. It sat like that for ~6 years with no ill effects.
I’ve heard that BS claim on HAD comments before. They are designed to be stacked like that. Apple even recommended it, and shows them that way in the old ads.
http://farm4.staticflickr.com/3101/3235501347_a405477d9e_b.jpg
Umm, the Apple ][e ran Applesoft basic and it could run ProDOS or Apple DOS. Most Apple ][s that I used ran Apple DOS 3.3. ProDOS disks were pretty rare in my experience.
Now, you could run Pascal but it cost extra to purchase.
For the IIe, sure. ProDOS was more on the 3.5″ hard-shelled floppies commonly used with the IIc+ or the IIgs
Hi, I wrote the original with my friend Martin.
The monitor is *much* lighter than it looks — maybe 2 or 3 pounds. I very seriously doubt that it would damage the disk drives.
There were LISP interpreters for the BBC Microcomputer, the Commodore 64 and the Apple II, as well as other microcomputers of the era.
Why not use a null modem cable and Zmodem, Kermit, or even Xmodem?
‘Cause the Apple ][ (any) didn’t have a serial port. Adding one as a plug-in card was somewhat common for use of printers, modems and such though I never had one on my highly modified 192k RAM ][+ (custom character set, type-ahead buffer in hardware, 80 column card with custom firmware, etc.).
Actually there was one Apple II that did have a built-in serial port: Apple IIc. I used to use it to transfer floppy images, so I was also a bit surprised to see them using cassette interface. But thanks for the explanation, maybe they just didn’t have a serial card available.
The IIgs, as well. Works great with ADTPro for transfers.
Don’t forget the IIc+, as well. No external power brick on that version, same 8 pin connectors and pinout that the Macintosh used.
I am surprised that they didn’t have one. I thought they were very common in the day, Looks like you can still get them on ebay for about $30.
Hi I wrote the original post with my friend Martin.
Because if we took the easy way out, then it wouldn’t have been a hack! Also we didn’t have such modern conveniences as a “serial port” and a “modem”.
The Apple ][ had a Lisp in 1981. It was called PLisp.
http://www.flownet.com/ron/plisp.html
There was at least one other LISP available for the Apple II, along with Logo, a couple of versions of Forth, USCD Pascal, Fortran IV (using the basis of the Pascal operating system), and several other languages and development platforms. If you added one of the three Z-80 processor cards you could run anything available for CPM too.
The Apple II was truly amazing for the wide variety of programming languages available.
We used to do all sorts of fun stuff in LOGO at the Apple ][GS lab in my elementary school.
I was part of the MIT AI Lab, the Logo group, and we wrote Logo for the Apple II. I completed the project. Logo by the way is very Lisp-like internally and use assembled it on the PDP-10 and transferred the resulting HEX file over serial link. We used a switch box to transfer over RS232. You typed the command to download the hex file, and then flipped the switch and had the downloader ready on the apple II with its plug-in serial card. I think I still have one of these in the garage.
The first actual Lisp I saw on the “personal computer” was Z80, muLisp from Hawaii. We joked it was about the same speed on the AI / LCS computers when they were heavily loaded during the day.
Kinda lame to write it in C and then use a 6502 C compiler. Should have been written in 6502 assembly, or SWEET16.
Should have been written with a magnetized needle and a steady hand.
No, that would be stupid. But if you’re going to do useless hack, the least you can do is make a bit more interesting. Writing a mini LISP interpreter in C is not very interesting. Then using already existing tools to compile it to 6502 code and run it on the Apple are also not very interesting. People already had LISP running in the 80’s, on home computers that were even older and more limited than the Apple IIe.
ObM-x butterfly
Man I miss the Symbolics machines and Genera OS. Lisp native on the CPU with h/w support for types and Garbage collection.
But mostly I miss Presenters and Listeners instead of a dumb terminal like IO…
Ah lisp – those were the days ….
http://en.wikipedia.org/wiki/Genera_%28operating_system%29
http://en.wikipedia.org/wiki/Common_Lisp_Interface_Manager
Lol I find this highly entertaining.
Article says something wasn’t possible. Commenter notes that it was. Some other commenter says something wasn’t possible and is corrected.
No-one knows anything! Or everyone from that era became senile :P
Hi, I wrote the original post with my friend Martin.
If there is disagreement about the article, I’ve found that in practice it’s usually because something was underspecified — when someone asks why we didn’t do X, it’s usually either the case that we forgot to tell them about some aspect of our situation that made X impossible, or it’s the case that the documentation about our setup was so bad that we couldn’t figure our how to do X.
Believe me — writing the software to transmit the data via audio jack was really goddamn hard, and if we could have avoided it, we definitely would have.
My other car is a cdr
The article claims “There is no assembler and no text editor, so the only development possibility other than BASIC is to implement directly in machine code.”
Here you go:
http://www.mozomedia.com/apple2/downloads/merlin-doc.zip
I wrote a lot of Assembler using Merlin on an Apple ][e in the late 1980s.
Good times…
Hi, I wrote the original article with my friend Martin.
Thanks for the tip! We are actually aware that there are text editors and assemblers for the Apple //e. What we hoped was clear from the article is that neither exist on this version of ProDOS. Furthermore, as the article suggests, we would have no way of transmitting such programs to the Apple //e, since we had no extra auxiliary storage, and in particular no disks. We wrote the lisp using an assembler and a text editor on our laptops, and the program to perform the audio transport — so this ultimately would not have helped us significantly.
I guess I am supposed to make a turbo prolog joke in here somewhere.
ADTpro is pretty slick I admit, but also far from the only way these days.
As someone who still maintains a functional Apple//e on the network, I highly recommend a device called the CFFA 3000.
(Not affiliated, just a proud owner of one)
It plugs in a slot and emulates a 5.25″ disk controller in slot 6 and a scsi controller in slot 5. It has a CF flash slot and a USB connector for media, plus a front control panel.
You load your USB stick with disk images, use an onscreen menu to load up images in each virtual disk drive, and use the buttons on the control pad to swap disks.
It’s a great way both to backup your old basic disks, as well as run backed up software on the real thing without needing blank 5.25″ floppies as ADTpro needs, nor waiting for 15 minutes to transfer a .wav just to find out the volume was too high.
Hi, I wrote the original article with my friend Martin.
Actually, that’s really cool! Thanks very much for the tip!
FTR though we didn’t do this because it’s the *only* way, we did it this way because it was the only way we could do it using the technology we had lying around. We of course could have just bought more equipment.
Needs a 6502 tag!
When I ported Kalawaum from the Atari ST to the Commodore PET series, I created a .wav File from the emulator, put this on an audio cassette (AFTER aligning the tape heads to those from the PETs drive), which took 5 minutes, and then another 5 minutes on the PET to see whether or not it worked (it took up to 4 tries to get it to work). Then copied it to disk, because the game does load level files from disk (which I had to re-create with the leveleditor, since I couldn’t copy data files this easily) and checked, if it worked (since sometimes I got a LOADING..READY message when in fact there WAS an error. I once wrote over a working version. That was frustrating.)
(if you wanna see, enter Kalawaum on youtube)
After transferring the interpreter, with ADTPro, you could bsave it (preferably to a disk other then your system master).
BSAVE Lisp ,A$2000,E$43A0
if i’m reading the screen right. Then you can use -Lisp to run it in the future. If it’s not dependent upon BASIC.system, you could add ,Tsys to that command, and could then also be launched from any launcher (ProSel, MouseDesk, IIgs finder, the stock quit handler, etc).