104 lines
3.3 KiB
Markdown
104 lines
3.3 KiB
Markdown
# beowulf
|
|
|
|
LISP 1.5 is to all Lisp dialects as Beowulf is to Emglish literature.
|
|
|
|
## What this is
|
|
|
|
A work-in-progress towards an implementation of Lisp 1.5 in Clojure. The
|
|
objective is to build a complete and accurate implementation of Lisp 1.5
|
|
as described in the manual, with, in so far as is possible, exactly the
|
|
same bahaviour - except as documented below.
|
|
|
|
### Status
|
|
|
|
Boots to REPL, but few functions yet available.
|
|
|
|
### Architectural plan
|
|
|
|
Not everything documented in this section is yet built. It indicates the
|
|
direction of travel and intended destination, not the current state.
|
|
|
|
#### resources/lisp1.5.lsp
|
|
|
|
The objective is to have within `resources/lisp1.5.lsp`, all those functions
|
|
defined in the Lisp 1.5 Programmer's Manual which can be implemented in Lisp.
|
|
|
|
This means that, while Beowulf is hosted on Clojure, all that would be
|
|
required to rehost Lisp 1.5 on a different platform would be to reimplement
|
|
|
|
* bootstrap.clj
|
|
* host.clj
|
|
* read.clj
|
|
|
|
#### beowulf/boostrap.clj
|
|
|
|
This file is essentially Lisp as defined in Chapter 1 (pages 1-14) of the
|
|
Lisp 1.5 Programmer's Manual; that is to say, a very simple Lisp language,
|
|
which should, I believe, be sufficient in conjunction with the functions
|
|
provided by `beowulf.host`, be sufficient to bootstrap the full Lisp 1.5
|
|
interpreter.
|
|
|
|
In addition it contains the function `INTEROP`, which allows host language
|
|
functions to be called from Lisp.
|
|
|
|
#### beowulf/host.clj
|
|
|
|
This file provides Lisp 1.5 functions which can't be (or can't efficiently
|
|
be) implemented in Lisp 1.5, which therefore need to be implemented in the
|
|
host language, in this case Clojure.
|
|
|
|
#### beowulf/read.clj
|
|
|
|
This file provides the reader required for boostrapping. It's not a bad
|
|
reader - it provides feedback on errors found in the input - but it isn't
|
|
the real Lisp reader.
|
|
|
|
Intended deviations from the behaviour of the real Lisp reader are as follows:
|
|
|
|
1. It reads the meta-expression language `MEXPR` in addition to the
|
|
symbolic expression language `SEXPR`, which I do not believe the Lisp 1.5
|
|
reader ever did;
|
|
2. It treats everything between a semi-colon and an end of line as a comment,
|
|
as most modern Lisps do; but I do not believe Lisp 1.5 had this feature.
|
|
|
|
|
|
### BUT WHY?!!?!
|
|
|
|
Because.
|
|
|
|
Because Lisp is the only computer language worth learning, and if a thing
|
|
is worth learning, it's worth learning properly; which means going back to
|
|
the beginning and trying to understand that.
|
|
|
|
Because there is, so far as I know, no working implementation of Lisp 1.5
|
|
for modern machines.
|
|
|
|
Because I'm barking mad, and this is therapy.
|
|
|
|
## Installation
|
|
|
|
At present, clone the source and build it using
|
|
|
|
`lein uberjar`.
|
|
|
|
You will require to have [Leiningen](https://leiningen.org/) installed.
|
|
|
|
## Usage
|
|
|
|
`java -jar beowulf-0.1.0-standalone.jar`
|
|
|
|
This will start a Lisp 1.5 read/eval/print loop (REPL).
|
|
|
|
To end a session, type `quit` at the command prompt.
|
|
|
|
## Learning Lisp 1.5
|
|
|
|
The `Lisp 1.5 Programmer's Manual` is still
|
|
[in print, ISBN 13 978-0-262-13011-0](https://mitpress.mit.edu/books/lisp-15-programmers-manual); but it's also
|
|
[available online](http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf).
|
|
|
|
## License
|
|
|
|
Copyright © 2019 Simon Brooke. Licensed under the GNU General Public License,
|
|
version 2.0 or (at your option) any later version.
|