Today in Computational Necromancy:

Turning the Apple //e into a Lisp Machine

But, while we didn't have extra floppy disks, we did have our laptops. So, we ended up writing some C code that allows us to encode arbitrary binary data as an audio signal. Using this, we were able to write the lisp prototype on our laptops, and simply transmit the program via the audio jack to the Apple //e.

Previously, previously, previously, previously, previously, previously, previously.

Tags: , , , ,

17 Responses:

  1. jwz says:

    Yeah yeah, it's not really a Lisp Machine. LM implies at least one of: Lisp-tuned instruction set; boot-to-Lisp; self-hosted Lisp-based OS. It's still amazing, though.

    • grェ says:

      Of which there were only three commercial vendors; two of which rms seems to have made it his personal mission to undermine (Symbolics being the more noteworthy; but the Texas Instrument story wherein Stallman apparently describes his take on nasal sex with flowers and is asked not to continue his lecture series is perhaps the more eyebrow raising). He didn't seem to hate on LMI much; but the whole thing gave rise to his creation of GNU and the GPL and all of that. Not that it seems the GPL has been without its share of violations, corporations still exist. I'm glad to hear at least the creators of this //e LISP released it under an MIT license (which seems more appropriate, far saner and less politicized than the GPL).

      And well, the Unix Hater's Handbook, which leaves the impression that perhaps the world might have been better if we did still have LISPMs; I think at least personally speaking, I am still curious about them. OpenGenera (which was the port/emulation of Symbolics' Genera for DEC Alphas/Digital Unix) can sort of be run/emulated on amd64 linux systems if you can find the relatively rare materials to load. The FrameThrower is to this day probably the best branded GPU name conceivable. I've had one person I'd call a friend who had an XL1200 that became damaged (I suspect more like, gutted to make forensics difficult if such an eventuality were to arise) but there's a hacker space in Toronto that has it now and has made some efforts to repair it. The only other person I ever met who used anything of the Symbolics vintage was Tim May, who made some off hand analogy about how when China decided to start a steel industry, Taiwan got into semiconductors and I would be wise not to go digging up old methods. (head scratch; he was reading some dissertation on Haskell at the time, yay cipherpunks meetings?)

      But there are (or at least were, they're hard to find now) some pretty interesting write ups on such systems. Genera in particular sounded like a pretty awesome environment, and whatever the esoteric hardware architecture allowed for their C compiler to have flags which would trip/alert on myriad forms of out of bound memory errors (purportedly thwarting swaths of buffer overflow type exploitation methodologies). Supposedly some systems were even red teamed unsuccessfully once upon a time, they had TCP/IP stacks available (and more esoteric things like CHAOSNet) X windowing systems (shudder, I think the default GUI was something else in screenshots I've observed) and what generally sounded like perhaps the most object oriented/editable/reconfigurable OS paradigms imaginable, down to being able to edit microcode. Albeit, such features sound like a great way to brick a system in the hands of the uninitiated (particularly in this day and age where I'm increasingly convinced we are churning out less skilled programmers than ever), and I think it probably makes a lot of sense that they grew up in a lab, but perhaps never did very well growing out of one.

      Some technologies are made by cabals, which once disbanded, may be impossible to recreate sanely. And if rms is any indicator of keeping the torch alive for a system he claims to have loved so much, his compatriots were likely also far from sane (or at least sane enough to try to escape, while he languished on).

      But LISP, scheme, forth all have pretty entrenched legacies, I think mostly because if I'm to understand correctly, MIT used to mandate LISP in their intro CS classes (this is no longer the case I am now told). It's cute to see such a thing incarnated on some different vintage hardware. Kudos on using the headphone jack, it sure beats a paper tape of infinite length. ;)

  2. ckd says:

    "Jump starts with G." Or, y'know, maybe it's short for "GO".

  3. Alex Clemmer says:

    I wrote this post with my friend Martin!

    To answer the questions so far in the comments:

    (1) yep, many people wrote in to tell us it wasn't actually a lisp machine, but in our defense, we're young and have no idea what the hell we're doing.

    (2) We know jump doesn't start with a G. :) That was just a bad joke.

    If you ask questions here I'm happy to respond to them!

    • Will says:

      Try as I might I cannot get this to build with xa. I got xa65 to build with a little futzing, but it balks at a LDY #-3. Changing that to LDY #$FD allows it to compile, but the output is a couple hundred bytes, not the 9K that appears in the video. Also in the video you mention cl65, curious what prompted the switch.

      • Will says:

        OK, re-reading the readme more carefully this makes sense, except for the part of the makefile where you're using gcc instead of cc65.

        • Will says:

          OK, I take that back - nothing very coherent is going on in the Makefile.

          • Will says:

            Yeah, had to throw out what you were doing in the Makefile and just copy what you did in the video to make it work. I should point out, though, at 9K, you'd have a reasonable chance of getting it to run on a pimped out Apple 1.

              • Alex Clemmer says:

                Wow, thanks for putting the work in to reproduce the results. #science.

                Yes, indeed, sorry about the makefile -- it is in sort of a Frankenstein's monster state right now, halfway accomplishing sending the 6502 assembly version over the wire (which exists on our laptops and not in the repot) and halfway accomplishing sending the C prototype.

                I will go back and fix this today. Deepest apologies, this slipped my mind.

    • Charles Stephens says:

      I was watching the video and some things stuck out as odd…

      You really don't need to boot ProDOS if your program doesn't do any disk I/O. CTRL-Reset should do the trick.

      Also, I couldn't see from the video, but if your Apple IIe has a 65C02? If so, then it probably does have a built in mini-assembler. Try jumping to $F666.

      Lastly, are you using the GETLN routine for input? I could have swore it supported some limited editing, at least backspace. I do remember that it conveniently puts the input at $0200.

      Enjoy, that machine brings back so many memories. I should dust off mine and plug it in again sometime.

      • Will says:

        As sexy as the mini assembler is, I really doubt you'd actually want to try and do software development using it. It's probably most useful for breaking copy protection. And, yeah, they might benefit from familiarizing themselves with the monitor routines.

        • moof says:

          The mini-assembler wasn't all that useful for breaking copy-protection; after a while you remember most of the common opcodes directly, along with the usual monitor incantations (9600<C600.C6FFM 96F8:4C 59 FF N 9600G enter 9659:28 N 84A:4C 59 FF N or other fiddling with the 0-sector code, etc.)

          Why I can remember this crap from 25+ years ago but not remember my own phone number, I don't know.

      • Alex Clemmer says:

        These things struck you as odd because we literally had no idea how to do anything on the Apple //e before we started. Literally no idea. Didn't even know how to turn the thing on and boot up ProDOS at all.

        We booted up ProDOS to get to the Monitor program. Ctrl-Reset always killed the current process for us -- is that wrong? Does this get you to a place where you can load contiguous chunks from audio to RAM? We didn't see how.

        Our Apple //e did not have a mini-assembler. We tried very hard to find it. Very very hard. In the end it wouldn't have been a good dev tool, though, because we had no aux storage to put the lisp, other than our laptops.

        We are unfortunately not using getln. We're using whatever the get-char routine is. And it's not really a routine -- you manually get the character and ack it. It's hilariously arcane.

        You should dust yours off!

  4. Argonel says:

    All I have to say about this is that I hope at least one person chooses to distribute software as an audio CD for this.

  5. This is just using the standard tape interface, so I suppose from a British point of view this is somewhat less of an esoteric hack. At least as far back as 1988 there seem to have been similar interpreters available for the C64, albeit in disk format (though I suppose in 1988 it wasn't quite so impossible to write a physical disk on common media that you could stick directly into the thing).

  6. gryazi says:

    Some presumably-ancient and presumably-emulator-ready C64 stuff here, if anyone wants to compare/contrast then vs. now:

    How much RAM is in that IIe?

  • Previously