C#: add metadata and atoms.
[jackhill/mal.git] / README.md
CommitLineData
60154d24
JM
1# mal - Make a Lisp
2
bcddc3e4
JM
3## Description
4
5Mal is an interpreter for a subset of the Clojure programming
6language. Mal is implemetated from scratch in 10 different languages:
7
8* Javascript
9* Python
10* Clojure
11* C
12* Java
13* PHP
14* Bash shell
15* GNU Make
16* mal itself
17* Postscript (in-progress)
18
19
20Mal is also a learning tool. Each implentation of mal is separated
21into 11 incremental, self-contained (and testable) steps that
22demonstrate core concepts of Lisp. The last step is capable of
23self-hosting (running the mal implemenation of mal).
24
25The mal (make a lisp) steps are:
26
27* step0_repl
28* step1_read_print
29* step2_eval
30* step3_env
31* step4_if_fn_do
32* step5_tco
33* step6_file
34* step7_quote
35* step8_macros
36* step9_interop
37* stepA_more
38
39
40Mal was presented publicly for the first time in a lightning talk at
41Clojure West 2014 (unfortunately there is no video). See
42mal/clojurewest2014.mal for the presentation that was given at the
43conference (yes the presentation is a mal program).
60154d24
JM
44
45## Building/running implementations
46
bcddc3e4 47### Bash 4
60154d24
JM
48
49```
50cd bash
51bash stepX_YYY.sh
52```
53
bcddc3e4 54### C
60154d24 55
54c75382
JM
56The C implementation of mal requires the following libraries: glib,
57libffi6 and either the libedit or GNU readline library.
58
60154d24
JM
59```
60cd c
61make
62./stepX_YYY
63```
64
bcddc3e4 65### Clojure
60154d24
JM
66
67```
68cd clojure
69lein with-profile +stepX trampoline run
70```
71
bcddc3e4 72### Java 1.7
60154d24
JM
73
74```
75cd java
76mvn compile
77mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY
78 # OR
79mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY -Dexec.args="CMDLINE_ARGS"
80```
81
bcddc3e4 82### Javascript/Node
60154d24
JM
83
84```
85cd js
54c75382 86npm update
60154d24
JM
87node stepX_YYY.js
88```
89
bcddc3e4 90### Mal
60154d24
JM
91
92Running the mal implementation of mal involves running stepA of one of
93the other implementations and passing the mal step to run as a command
5d446bd8 94line argument.
60154d24
JM
95
96```
97cd IMPL
98IMPL_STEPA_CMD ../mal/stepX_YYY.mal
99
100```
101
bcddc3e4 102### GNU Make 3.81
60154d24
JM
103
104```
105cd make
106make -f stepX_YYY.mk
107```
108
bcddc3e4 109### PHP 5.3
60154d24
JM
110
111```
112cd php
113php stepX_YYY.php
114```
115
bcddc3e4 116### Postscript Level 2/3
60154d24
JM
117
118```
119cd ps
120gs -q -dNODISPLAY stepX_YYY.ps
121```
122
bcddc3e4 123### Python 2.X
60154d24
JM
124
125```
126cd python
127python stepX_YYY.py
128```