My aim in designing the first Tiny Lisp Computer was to create the smallest practical self-contained computer, with its own display and keyboard, that you could use to program in Lisp.
This second version extends the original Tiny Lisp Computer with four improvements: it uses the ATmega1284 to give it more program space; it includes parenthesis matching to make it easier to enter programs; it allows you to connect it to a computer via the USB port, to enter programs from the Arduino IDE's serial monitor; and it includes a built-in program editor, to allow you to make changes to programs without having to enter them again. [...]
As an example of using the program editor, enter the following function b that blinks the LED on pin 13 once a second:(defun b (x) (pinmode 13 t) (digitalwrite 13 x) (delay 500) (b (not x)))Suppose we now want to change the delay parameter to 250 to make it blink twice as quickly. First give the command:(edit 'b)The editor prints the current context:(lambda (x) (pinmode 13 t) (digitalwrite 13 x) (delay 500) (b (not x)))where lambda is the internal representation for a function. Get to the delay command by typing:ddddThe editor prints:((delay 500) (b (not x)))Now get to the 500 by typing:adaThe editor responds:500Replace this with 250 by typing:r250The editor responds:250We can confirm that we've changed the correct value by backing up with:bbThe editor responds: (delay 250) Quit from the editor with:qFinally run the program to confirm that the change has been made:(b nil)
Code-data equivalence FTW! I am also pleased to note the tail-call elimination.
Honestly, I don't think the Atari 2600 BASIC has ever had a fair review. It's pretty much reviled as a horrible program, a horrible programming environment and practically useless. But I think that's selling it short. Yes, it's bad (and I'll get to that in a bit), but in using it for the past few days, there are some impressive features on a system where the RAM can't hold a full Tweet and half the CPU time is spent Racing The Beam. I'll get the bad out of the way first. [...]
And given that the Atari 2600 only has 128 bytes of memory, it's expected that the programs are going to be rather short. I at first thought that you had 64 bytes for the program, but no -- it's 64 bytes for the program, variables and runtime expression evaluation! [...]
Despite it being only 4,096 bytes, there's a pretty credible, windowed(!) integrated development environment in there. [...] The "STATUS" window (you can see it in the screen shot from the other day) shows memory usage (how many bytes, called "symbols") and how fast the program will run (1, 2, 4, 8, 15, 30 and 60 are the speed values and they reflect how often the interpreter is run -- once a second, twice a second, on up to 60 times a second). The "PROGRAM" window obviously contains the program (all nine lines if you have that many).