4 A hobby Scheme interpreter for FORTH 83. Specifically it is targeted at
5 [forth.jl](http://github.com/tgvaughan/forth.jl) which is an implementation of
6 FORTH on top of [Julia](http://www.julialang.org), hence the name. It began
7 life as a fairly direct port of Peter Micheaux's [Bootstrap
8 Scheme](https://github.com/petermichaux/bootstrap-scheme) (as described in
9 [this wonderful series of blog
10 posts](http://peter.michaux.ca/articles/scheme-from-scratch-introduction)) from
11 C to forth, but also includes variadic compound function support, mark-sweep
12 garbage collection, quasiquotation, and a basic (non-hygienic) macro
15 In future, I plan to also implement a more complete numerical tower to bring it closer to
16 [R5RS](http://www.schemers.org/Documents/Standards/R5RS/).
18 The goal is for the interpreter to be complete enough to be used to complete
19 the majority of the exercises found in [SICP](http://sarabander.github.io/sicp/).
21 Running the interpreter
22 =======================
24 To run this Scheme interpreter, first open Julia from the src directory contained
25 in this repository. If you've not done so already, install forth.jl using the
28 julia> Pkg.clone("https://github.com/tgvaughan/forth.jl")
30 Then, import and run the Forth system:
36 Once Forth is running, execute the Scheme source and fire up the
37 REPL using the following commands:
41 Welcome to scheme.forth.jl!
46 At this point you can start entering Scheme commands. For example,
48 > (define (factorial n)
51 (* n (factorial (- n 1)))))
56 Metacircular Evaluator
57 ======================
59 Of course, one of the things you can do in Scheme (or of course any programming
60 language, this is the fundamental thing) is implement an interpreter for
61 another programming language. The examples directory in this repository
62 contains a verbatim copy of the source for the "metacircular" scheme interpreter
63 from SICP. To load it, use the following command:
65 > (load "../examples/metacirc.scm")
68 Be prepared to wait a couple of minutes. When the interpreter finally loads, enter
69 the following command to run it:
73 You'll then be greeted by the following prompt:
77 At this point you can start entering Scheme commands... but be prepared to wait
78 a _long_ time for the result. For instance, the following example from SICP
79 defines and demonstrates a recursive list append procedure:
91 (append '(a b c) '(d e f))
96 Be prepared to wait 20 min or more for the final result to be printed. (Given
97 that at this point we have a program running in a Scheme interpreter running
98 inside another Scheme interpreter which is itself running on a Forth system
99 that is implemented in Julia, this should not be a surprise.)
104 This software is free (as in freedom) and is distributed under the terms
105 of version 3 of the GNU General Public License. A copy of this license
106 is included in this repository in the file COPYING.