169 points · by antics · 13y ago · 62 comments
http://www.flownet.com/ron/plisp.html
Complete with disk images so you can run it yourself on a real Apple or an emulator.
The last chapter is particularly interesting, as it describes the inner workings of the interpreter.
http://www.pjrc.com/store/teensy3.html
Never finished it, but if you like these kinds of challenges maybe you'd like to collaborate on it.
Generally a Lisp Machine is also really a piece of hardware designed to run Lisp. The CPU of a Symbolics for example is a (mostly) stack machine which knows all kinds of Lisp data types and Lisp function calling conventions. The memory then also contains Lisp data (with tags for data types and GC which are used by the CPU directly). Additionally the Lisp that runs on top of it is providing OS services: device control, I/O, keyboard, disks, tapes, expansion cards, graphics, sound, network, scheduling, ...
Getting a Lisp on an Apple II to the level of the built-in Apple Basic with access to keyboard, graphics, etc. should be fun. I'm looking forward to read more of your adventures!
As it turned out, Unix workstations ran Lisp just fine. So when the 80s AI winter drying up budgets, AI labs decided to buy cheaper SUN workstations and the Lisp machine companies failed.
Because the Apple ][ was a locked design, folks started poking directly into ROM and RAM locations, for instance directly manipulating system variables, or even jumping into the middle of ROM subroutines. A book called "What's Where in the Apple II" documented almost every known hook.
My mom had that book. She's my hacker role model.
As a result of the way that software interacted, it became virtually impossible for Apple to update the ROMs without breaking popular apps.
The next generation of personal computers all represented different approaches to avoiding this problem by providing well documented entry points while offering no guarantee of long term code stability. IBM made one mistake: They let people hard code the address of video RAM, which is what led to the legendary 640k barrier.
Having BASIC (or another language) built into the machine was a big plus and encouraged people to see continuity between the OS, the hardware and the code.
If that BASIC had to use built-in functions and data-types instead of simply POKE-ing and PEEKING-ing as a de facto interface with the underlying machine code, that would still have been hacker-friendly without being inflexible.
It was such a weird relationship between desktop machines and UNIXes back then. It's like the desktop designers had to re-learn the lessons of UNIX in the small. So much was forgotten.
Two years later I got a '386 clone, bought Turbo C and all the fun came back at once.
I was alive and programming back when the Apple IIe was popular. While I mostly wrote code for the Commodore 64 and Atari systems of the time, I did write a bit of code for the Apple II and IIe.
Those computers are primitive by today's standards, but nobody was entering hex codes. That ended with computers like the ELF II. A lot of the machine code programming was done with a program called a 'monitor' program that was much like the DOS debug program that allowed viewing and writing memory as well as a single line assembly (i.e. inline assembly) that would allow writing programs a line a time in assembly.
But most of the programming was being done using assembler's and compiler's like the Aztec/Manx C compiler that is still availble today (google it) so what they are doing and saying is BS.
I enjoyed using GraFORTH, which was a 10 kb dialect of FORTH with bitmapped and 3D wireframe graphics (!) that compiled to threaded code.
Applesoft (licensed from Micosoft) had 16-bit integer variables (such as A%) as well as floating point, but you are right that it converted them to and from real with every operation, which was slow. They were useful for saving memory (2 bytes instead of 5) and not much else.
There were BASIC extensions published in places like Nibble and Call-A.P.P.L.E. that added native integer math to Applesoft using the & command, so you could write things like "A% = B% &+ C%", and the operation was performed without conversion to real.
Let's also not forget SWEET-16, Woz's software emulation of a 16-bit kind-of-RISC processor on the 6502, that had 16-bit arithmetic. Reading the source code of SWEET-16 blew my young, impressionable mind.
Could have developed off machine then ported over to the ][ lots of resources here: http://6502.org/
like XA65: http://www.floodgap.com/retrotech/xa/
Much 8 bit development nowadays (and there still is a lot) is cross-platform.
plus many many apple ][ emulators for debugging... even some running via browser.
http://www.cliki.net/VLM_on_Linux
I've been meaning to try this - perhaps I'll write up a better tutorial (or better, an ansible playbook) to set it up.
... Though, credit where credit is due, the C code we used to generate the audio signal actually is pretty much a direct port of the corresponding code in ADTPro. One of the reasons it's released separately from our lisp code is because ADTPro is LGPL and we prefer the MIT license. :) One of these days I'll make the port more independent and less derivative, so they can all be in the same project.
David Schmidt has contributed a lot of free software to the Apple II community over the years and, IMHO, deserves recognition for his work by those that build upon it.
EDIT: Aaaaaand acknowledgement pushed into post. Cheers.
[1]: Specifically located here: https://github.com/hausdorff/apple2e-audio-transport