Moved source to src directory.
[scheme.forth.jl.git] / README.md
1 scheme.forth.jl
2 ---------------
3
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 very basic (non-hygenic) macro
13 system.
14
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/).
17
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/).
20
21 Running the interpreter
22 =======================
23
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
26 following command:
27
28     julia> Pkg.clone("https://github.com/tgvaughan/forth.jl")
29
30 Then, import and run the Forth system:
31
32     julia> import forth
33     julia> forth.run()
34     Welcome to forth.jl!
35
36 Once Forth is running, execute the Scheme source and fire up the
37 REPL using the following commands:
38
39     include scheme.4th  ok
40     scheme repl
41     Welcome to scheme.forth.jl!
42     Use Ctrl-D to exit.
43
44     >
45
46 At this point you can start entering Scheme commands.  For example,
47
48     > (define (factorial n)
49         (if (= n 0)
50           1
51           (* n (factorial (- n 1)))))
52     ; ok
53     > (factorial 5)
54     ; 120
55
56 License
57 =======
58
59 This software is free (as in freedom) and is distributed under the terms
60 of version 3 of the GNU General Public License.  A copy of this license
61 is included in this repository in the file COPYING.