diff --git a/README.md b/README.md index 7c781ed..47aee7e 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,20 @@ 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. +#### There are other barking mad people out there + +Since I wrote Beowulf, I've become aware of other modern reimplementations of Lisp 1.5: + +1. [Kenichi Sasagawa's in C](https://github.com/sasagawa888/lisp1.5); +2. [Ichigo Lisp, in JavaScript, which compiles to Web Assembly](https://github.com/zick/IchigoLisp); +3. [Geert Bosch's implementation in ADA](https://github.com/GeertBosch/lisp); + +There are probably others. + +In addition, [this](https://github.com/informatimago/lisp-1-5) appears to be a transcription of the original IBM 709 card deck for the Lisp 1.5 system. There's an IBM 709 emulator [here](https://github.com/Bertoid1311/B7094) on which it might be possible to actually run this. + ### Status Working Lisp interpreter, but some key features not yet implemented. diff --git a/docs/codox/beowulf.bootstrap.html b/docs/codox/beowulf.bootstrap.html index ffcf6bb..c9ba900 100644 --- a/docs/codox/beowulf.bootstrap.html +++ b/docs/codox/beowulf.bootstrap.html @@ -3,13 +3,13 @@ beowulf.bootstrap documentation

beowulf.bootstrap

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..

The convention is adopted that functions in this file with names in ALLUPPERCASE are Lisp 1.5 functions (although written in Clojure) and that therefore all arguments must be numbers, symbols or beowulf.cons_cell.ConsCell objects.

*depth*

dynamic

Stack depth. Unfortunately we need to be able to pass round depth for functions which call EVAL/APPLY but do not know about depth.

-

APPLY

(APPLY function args environment)(APPLY function args environment depth)

Apply this function to these arguments in this environment and return the result.

+

APPLY

(APPLY function args environment)(APPLY function args environment depth)

Apply this function to these arguments in this environment and return the result.

For bootstrapping, at least, a version of APPLY written in Clojure. All args are assumed to be symbols or beowulf.cons-cell/ConsCell objects. See page 13 of the Lisp 1.5 Programmers Manual.

-

apply-label

(apply-label function args environment depth)

Apply in the special case that the first element in the function is LABEL.

-

EVAL

(EVAL expr)(EVAL expr env depth)

Evaluate this expr and return the result. If environment is not passed, it defaults to the current value of the global object list. The depth argument is part of the tracing system and should not be set by user code.

+

apply-label

(apply-label function args environment depth)

Apply in the special case that the first element in the function is LABEL.

+

EVAL

(EVAL expr)(EVAL expr env depth)

Evaluate this expr and return the result. If environment is not passed, it defaults to the current value of the global object list. The depth argument is part of the tracing system and should not be set by user code.

All args are assumed to be numbers, symbols or beowulf.cons-cell/ConsCell objects. However, if called with just a single arg, expr, I’ll assume it’s being called from the Clojure REPL and will coerce the expr to ConsCell.

-

find-target

TODO: write docs

-

PROG

(PROG program env depth)

The accursed PROG feature. See page 71 of the manual.

+

find-target

TODO: write docs

+

PROG

(PROG program env depth)

The accursed PROG feature. See page 71 of the manual.

Lisp 1.5 introduced PROG, and most Lisps have been stuck with it ever since. It introduces imperative programming into what should be a pure functional language, and consequently it’s going to be a pig to implement.

Broadly, PROG is a variadic pseudo function called as a FEXPR (or possibly an FSUBR, although I’m not presently sure that would even work.)

The arguments, which are unevaluated, are a list of forms, the first of which is expected to be a list of symbols which will be treated as names of variables within the program, and the rest of which (the ‘program body’) are either lists or symbols. Lists are treated as Lisp expressions which may be evaulated in turn. Symbols are treated as targets for the GO statement.

@@ -21,10 +21,10 @@

Flow of control: Apart from the exceptions specified above, expressions in the program body are evaluated sequentially. If execution reaches the end of the program body, NIL is returned.

Got all that?

Good.

-

prog-eval

(prog-eval expr vars env depth)

Like EVAL, q.v., except handling symbols, and expressions starting GO, RETURN, SET and SETQ specially.

-

SASSOC

(SASSOC x y u)

Like ASSOC, but with an action to take if no value is found.

+

prog-eval

(prog-eval expr vars env depth)

Like EVAL, q.v., except handling symbols, and expressions starting GO, RETURN, SET and SETQ specially.

+

SASSOC

(SASSOC x y u)

Like ASSOC, but with an action to take if no value is found.

From the manual, page 60:

‘The function sassoc searches y, which is a list of dotted pairs, for a pair whose first element that is x. If such a pair is found, the value of sassoc is this pair. Otherwise the function u of no arguments is taken as the value of sassoc.’

-

try-resolve-subroutine

(try-resolve-subroutine subr args)

Attempt to resolve this subr with these args.

-

value

(value s)(value s indicators)

Seek a value for this symbol s by checking each of these indicators in turn.

-
\ No newline at end of file +

try-resolve-subroutine

(try-resolve-subroutine subr args)

Attempt to resolve this subr with these args.

+

value

(value s)(value s indicators)

Seek a value for this symbol s by checking each of these indicators in turn.

+
\ No newline at end of file diff --git a/docs/codox/intro.html b/docs/codox/intro.html index e520149..35c0e33 100644 --- a/docs/codox/intro.html +++ b/docs/codox/intro.html @@ -45,8 +45,16 @@

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.

+

There are other barking mad people out there

+

Since I wrote Beowulf, I’ve become aware of other modern reimplementations of Lisp 1.5:

+
    +
  1. Kenichi Sasagawa’s in C;
  2. +
  3. Ichigo Lisp, in JavaScript, which compiles to Web Assembly;
  4. +
  5. Geert Bosch’s implementation in ADA;
  6. +
+

There are probably others.

+

In addition, this appears to be a transcription of the original IBM 709 card deck for the Lisp 1.5 system. There’s an IBM 709 emulator here on which it might be possible to actually run this.

Status

Working Lisp interpreter, but some key features not yet implemented.