WORK IN PROGRESS, THIS IS AMENDED AS I LEARN PDP-1 LISP MYSELF.
But hopefully, it will get you started. Feedback is very much solicited in the Google Group :-)



PDP-1 Lisp: Introduction
Lisp was developed in 1958 by John McCarthy at MIT. It pioneered a high-level, symbolic programming language designed for AI research. Early Lisp introduced key concepts such as recursion, symbolic expressions, and automatic storage management.

The PDP-1 version was implemented in 1960 by Peter Deutsch, the son of a MIT professor but at the time as a 14 year old, still at high school. It is a highly minimalist and efficient Lisp suitable for the tiny PDP-1. Notably, he invented the idea of a read–eval–print loop (REPL, famous to many of us from Python) along the way. In other words, this was the first-ever interactive programming environment — a major innovation and central to Lisp to this day. PDP-1 Lisp evolved Lisp from a theoretical, punch-card loaded language into a practical, interactive tool. A milestone in computing on its own!

This page only gives quick-start instructions for PDP-1 Lisp. Knowledge of Lisp is not required, this only shows how Lisp works on the PDP-1. Useful as a start into the Lisp world - and still interesting even if you do not want to learn more about Lisp itself.

Two manuals will be essential once you delve into more details. The first is the PDP-1 Lisp manual (link) and the second, the original, full-featured Lisp 1.5 Programmer's manual (link) for the IBM 7090, that Deutsch used as his target. The IBM Lisp 1.5 manual gives a good overview of Lisp 1.5 in general, the PDP-1 Lisp manual explains how to use the PDP-1 version - practical operation and language differences.


PDP-1 Lisp is much more tempting than I initially thought... But first, let us do a quick overview of PDP-1 Lisp in practice.
Bringing up Lisp
  • Set the Extend switch
    Be sure to set Extend down again for other PDP-1 programs. READ IN will fail for regular PDP-1 programs with this switch set, a major cause of confusion if you forget.
  • Mount the lisp.rim tape. Press READ IN.
  • Set the TW switches to 7750 to define upper memory address for Lisp storage, Press CONTINUE,
  • Set the TW switches to 400 to define the length of the push down list, Press CONTINUE,
  • Set Sense Switch 5, to enable typewriter input. Press CONTINUE a third time.
    If SS5 is left unset, input will come from a freshly inserted paper tape. So you could mount a paper tape with Lisp functions instead, and press Continue without SS5 being set. We'll come to that later.
You can now work in Basic Lisp for the PDP-1! Some things to know before you proceed:
  • Always set the Address Switches to 0004 at this point. Because after running a Lisp program you then just press START and CONTINUE to go back in to Lisp.
  • Also, typos and errors make Lisp come to a halt. That is normal. For instance, type 'nix[space]' instead of 'nil[space]'. In such situations, just press START, then CONTINUE. But make sure the Address switches point to the start location, 4, though.
  • Lines are not entered by hitting return, but by adding a closing space. So, to see what atomic symbols are defined, type oblist [Space].
  • Before you do any typing in, it is always useful to see if Lisp is still running! Enter 'nil', which you will always see typed out even if Lisp is not running. But Lisp should respond with a second 'nil' on a new line. If not: START, then CONTINUE. You will probably make a habit of quick 'nil' checks before you enter anything new in PDP-1 Lisp. It is also the best way to start on a new line...

Enter (plus 1 2) outputs 3. Note 'plus' rather than '+'! (times 4 4) correctly outputs 20. Because 20 octal is 16 decimal...
Now, let's enter a little program (use [Return] and [tab] keys when entering the program):

(prog (a b)
	(setq a 4)
	(setq b 4)
	(plus a b)
	(return (plus a b))) 

...and close with a [space]. This will return 10. Because, indeed, 4+4=10 in octal :-)
Loading and saving
Paper Tape Input
Because the Lisp function to actually save your newly created code to paper tape is not built in to Basic Lisp, you will first need to load such a function from paper tape. This is also just the regular way of loading any code in Lisp:
  • Mount the alphanumeric tape lisp-defs.pt
  • Set SS5 to down, and straight away the tape gets read in
  • You will see the newly loaded functions come by in the typewriter output:
    zerop 
    pdef 
    count
    
  • Set SS5 to up again for typewriter input
  • Press START, then CONTINUE. And make sure the Address switches are indeed set to 4.

This is how loading any Lisp code will work. Mount the alphanumeric tape with your functions, set SS5, and see them loaded in.

Make a test tape to read in your own functions
First, prepare a little test tape. Paste this in a file called test.lisp on your laptop:

(rplacd (quote tt)  (quote
	(expr (lambda ()
	(prog ()
	(print (quote hello))
	(terpri)
	(return 5))))))
[space] 

Make sure the last line of code has a space at the end of it to terminate the function.
Now make a paper tape image out of this text file, to read in to the PDP-1: encode_fiodec test.lisp test.pt
  • Mount the alphanumeric tape test.pt
  • Set SS5 to down, the tape gets read in
  • You will see the output:
    tt 
    
    hello
    
    5
    
  • Set SS5 to up again, to revert to typewriter input
  • Press START, then CONTINUE. And make sure the Address switches are indeed set to 4.

Now, to see the program that was just loaded: (print (cdr (quote tt)))


Contents of the lisp-defs paper tape:

(rplacd (quote zerop) (quote (expr (lambda (n) (eq n 0)))))

(rplacd (quote pdef) (quote (fexpr (lambda (x a) (list (quote r placd) (list (quote quote) (car x)) (list (quote quote) (cdr (ca r x))))))))

(rplacd (quote count) (quote (expr (lambda (n) (prog (u) (setq u n) (cond ((zerop u) (return nil))) (print u) (setq u (plus u ( minus 1))) (go a))))))


Paper Tape Output
(print (cdr (quote tt))) shows the body of the program, but it does not output the function definition! In other words, (rplacd (quote tt) (quote is not printed out. But you want to save the actual program definition on paper tape, so you can load it next time, punching (print (cdr (quote tt))) is not enough.

The solution is the function pdef that we loaded from the lisp-pdefs tape.
  • Turn up Sense Switch 3 to send output to the punch instead of the typewriter
  • Type (pdef tt), end with the trailing space character as always, and you see your function punched out to tape.
  • Turn down Sense Switch 3 to return to typewriter output, and save the paper tape for future use

Closing remark...
Of course, a PDP-1 uses core memory, and core memory is non-volatile. So if you shut down the P(i)DP-1, next time you power up, everything is still in memory. No need to bring up Lisp agin from paper tape. Just set the address switches to 4 and press START, then CONTINUE.


Loading DDT & mixing assembly in Lisp programs
For this, please refer to the PDP-1 Lisp manual (link). By setting a lower top address for Lisp, there is room at the top for DDT to live in. And you can jump from Lisp to DDT using the front panel START switch.


An AI tutor for PDP-1 Lisp
We have created some .md text files that you can literally paste into ChatGPT, Claude Code or any other AI, telling the AI to learn about PDP-1 Lisp and to become your programming aide. Try this! It gives you a very smart side-kick, even if it is not perfect. Just paste one or more of the .md files into the AI, let it process the information, then start asking questions or giving tasks.
  • PDP1.md: the text you want to paste into your AI as the base PDP-1 expertise.
  • lisp.md: teach the AI about PDP-1 Lisp
  • lisp1_5.md: teach the AI about the Lisp 1.5 Programmer's manual