Exploring PDP-1 Lisp (1960)

ozymandiax2 pts0 comments

Lisp programming on the PDP-1

PiDP-1<br>Manual<br>Games<br>Assembly<br>Lisp<br>Music

-->

Back

-->

PROGRAMMING LISP

ON THE DEC PDP-1

A HANDS-ON START

-->

CONTENTS

PDP-1 Lisp: Introduction

Bringing up Lisp

Loading and saving

Loading DDT & mixing assembly in Lisp programs

An AI tutor for PDP-1 Lisp

WORK IN PROGRESS, THIS IS AMENDED AS I LEARN PDP-1 LISP MYSELF.<br>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)<br>and the second, the original, full-featured Lisp 1.5 Programmer's manual (link)<br>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.

UPDATE: two more books were recommended on the PiDP-1 google group.

The first truly opens up Lisp on the PDP-1: The Programming Language LISP: Its Operation and Applications. After getting 'on the road' with the practicalities through this page, that should be the first thing to look at.

Then, Anatomy of Lisp and the background information on its author, John Allen and early Lisp.

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<br>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.<br>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...<br>Now, let's enter a little program (use [Return] and [tab] keys when entering the program):

(prog (a b)<br>(setq a 4)<br>(setq b 4)<br>(plus a b)<br>(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...

lisp start tape press continue first

Related Articles