5 Mal is a Clojure inspired Lisp interpreter.
7 Mal is implemented in 26 different languages:
18 * Javascript ([Online Demo](http://kanaka.github.io/mal))
23 * [miniMAL](https://github.com/kanaka/miniMAL)
37 Mal is a [learning tool](process/guide.md). Each implementation of mal is separated into 11
38 incremental, self-contained (and testable) steps that demonstrate core
39 concepts of Lisp. The last step is capable of self-hosting (running
40 the mal implemenation of mal).
42 The mal (make a lisp) steps are:
44 * [step0_repl](process/guide.md#step0)
45 * [step1_read_print](process/guide.md#step1)
46 * [step2_eval](process/guide.md#step2)
47 * [step3_env](process/guide.md#step3)
48 * [step4_if_fn_do](process/guide.md#step4)
49 * [step5_tco](process/guide.md#step5)
50 * [step6_file](process/guide.md#step6)
51 * [step7_quote](process/guide.md#step7)
52 * [step8_macros](process/guide.md#step8)
53 * [step9_try](process/guide.md#step9)
54 * [stepA_mal](process/guide.md#stepA)
57 Mal was presented publicly for the first time in a lightning talk at
58 Clojure West 2014 (unfortunately there is no video). See
59 mal/clojurewest2014.mal for the presentation that was given at the
60 conference (yes the presentation is a mal program).
62 ## Building/running implementations
73 The C implementation of mal requires the following libraries (lib and
74 header packages): glib, libffi6 and either the libedit or GNU readline library.
84 The C# implementation of mal has been tested on Linux using the Mono
85 C# compiler (mcs) and the Mono runtime (version 2.10.8.1). Both are
86 required to build and run the C# implementation.
99 lein with-profile +stepX trampoline run
105 sudo npm install -g coffee-script
119 You Go implementation of mal requires that go is installed on on the
120 path. The implementation has been tested with Go 1.3.1.
131 Install the Haskell compiler (ghc/ghci), the Haskell platform and
132 either the editline package (BSD) or the readline package (GPL). On
133 Ubuntu these packages are: ghc, haskell-platform,
134 libghc-readline-dev/libghc-editline-dev
145 The Java implementation of mal requires maven2 to build.
150 mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY
152 mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY -Dexec.args="CMDLINE_ARGS"
165 Running the Lua implementation of mal requires lua 5.1 or later,
166 luarocks and the lua-rex-pcre library installed.
170 make # to build and link linenoise.so
176 Running the mal implementation of mal involves running stepA of one of
177 the other implementations and passing the mal step to run as a command
182 IMPL_STEPA_CMD ../mal/stepX_YYY.mal
203 The MATLAB implementation of mal has been tested with MATLAB version
204 R2014a on Linux. Note that MATLAB is a commercial product. It should
205 be fairly simple to support GNU Octave once it support classdef object
211 matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY();quit;"
212 # OR with command line arguments
213 matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY('arg1','arg2');quit;"
218 [miniMAL](https://github.com/kanaka/miniMAL) is small Lisp interpreter
219 implemented in less than 1024 bytes of JavaScript. To run the miniMAL
220 implementation of mal you need to download/install the miniMAL
221 interpreter (which requires Node.js).
223 # Download miniMAL itself
224 git clone https://github.com/kanaka/miniMAL ../miniMAL.git
225 export PATH=`pwd`/miniMAL.git:$PATH
226 # Now run mal implementated in miniMAL
233 For readline line editing support, install Term::ReadLine::Perl or
234 Term::ReadLine::Gnu from CPAN.
244 The PHP implementation of mal requires the php command line interface
252 ### Postscript Level 2/3
254 The Postscript implementation of mal requires ghostscript to run. It
255 has been tested with ghostscript 9.10.
259 gs -q -dNODISPLAY -I./ stepX_YYY.ps
271 The R implementation of mal requires R (r-base-core) to run.
275 make libs # to download and build rdyncall
281 The Racket implementation of mal requires the Racket
282 compiler/interpreter to run.
298 The rust implementation of mal requires the rust compiler and build
299 tool (cargo) to build.
303 # Need patched pcre lib (should be temporary)
304 git clone https://github.com/kanaka/rust-pcre cadencemarseille-pcre
311 Install scala and sbt (http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html):
315 sbt 'run-main stepX_YYY'
318 scala -classpath target/scala*/classes stepX_YYY
321 ### Visual Basic.NET ###
323 The VB.NET implementation of mal has been tested on Linux using the Mono
324 VB compiler (vbnc) and the Mono runtime (version 2.10.8.1). Both are
325 required to build and run the VB.NET implementation.
337 The are nearly 500 generic Mal tests (for all implementations) in the
338 `tests/` directory. Each step has a corresponding test file containing
339 tests specific to that step. The `runtest.py` test harness uses
340 pexpect to launch a Mal step implementation and then feeds the tests
341 one at a time to the implementation and compares the output/return
342 value to the expected output/return value.
344 To simplify the process of running tests, a top level Makefile is
345 provided with convenient test targets.
347 * To run all the tests across all implementations (be prepared to wait):
353 * To run all tests against a single implementation:
363 * To run tests for a single step against all implementations:
373 * To run a specifc step against a single implementation:
385 Mal (make-a-lisp) is licensed under the MPL 2.0 (Mozilla Public
386 License 2.0). See LICENSE.txt for more details.