process/guide.md: Add TOC; fix heading levels
[jackhill/mal.git] / README.md
CommitLineData
60154d24
JM
1# mal - Make a Lisp
2
f9e6bb80
JM
3[![Build Status](https://travis-ci.org/kanaka/mal.svg?branch=master)](https://travis-ci.org/kanaka/mal)
4
bcddc3e4
JM
5## Description
6
27696157 7Mal is a Clojure inspired Lisp interpreter.
b76aa73b 8
3746594c 9Mal is implemented in 50 languages:
bcddc3e4 10
8c7587af 11* GNU awk
edc3b064 12* Bash shell
bcddc3e4 13* C
73fc9366 14* C++
edc3b064
JM
15* C#
16* Clojure
891c3f3b 17* CoffeeScript
6c4dede1 18* Crystal
f82cb965 19* D
bb526975 20* Elixir
e0b7f668 21* Emacs Lisp
2cc3804b 22* Erlang
88e934b6 23* ES6 (ECMAScript 6 / ECMAScript 2015)
6f78381f 24* F#
0fe47e88 25* Factor
96032890 26* Forth
1771ab50 27* Go
7ab0f63e 28* Groovy
7c6882f2 29* GNU Guile
b76aa73b 30* Haskell
33dec7af 31* Haxe
61f69fba 32* Io
bcddc3e4 33* Java
39381792
JM
34* JavaScript ([Online Demo](http://kanaka.github.io/mal))
35* Julia
53c2ea70 36* Kotlin
9d42904e 37* Lua
bcddc3e4
JM
38* GNU Make
39* mal itself
8a9d0a8a 40* MATLAB
1218ce98 41* [miniMAL](https://github.com/kanaka/miniMAL)
a2cd0a3a 42* Nim
0067158f 43* Object Pascal
7cae6e6f 44* Objective C
bc6448bc 45* OCaml
6301e0b6 46* Perl
edc3b064
JM
47* PHP
48* Postscript
49* Python
23e38cd2 50* RPython
9b3362e8 51* R
f5223195 52* Racket
8adb0827 53* Ruby
abdd56eb 54* Rust
821930db 55* Scala
8b142f08 56* Swift
ea1395aa 57* Swift 3
54d9903c 58* Tcl
50a964ce 59* Vimscript
ee7cd585 60* Visual Basic.NET
bcddc3e4
JM
61
62
bd08422d
JM
63Mal is a learning tool. See the [make-a-lisp process
64guide](process/guide.md). Each implementation of mal is separated into
6511 incremental, self-contained (and testable) steps that demonstrate
66core concepts of Lisp. The last step is capable of self-hosting
67(running the mal implementation of mal).
bcddc3e4
JM
68
69The mal (make a lisp) steps are:
70
0f4ca9d1
JM
71* [step0_repl](process/guide.md#step0)
72* [step1_read_print](process/guide.md#step1)
73* [step2_eval](process/guide.md#step2)
74* [step3_env](process/guide.md#step3)
75* [step4_if_fn_do](process/guide.md#step4)
76* [step5_tco](process/guide.md#step5)
77* [step6_file](process/guide.md#step6)
78* [step7_quote](process/guide.md#step7)
79* [step8_macros](process/guide.md#step8)
80* [step9_try](process/guide.md#step9)
90f618cb 81* [stepA_mal](process/guide.md#stepA)
bcddc3e4
JM
82
83
84Mal was presented publicly for the first time in a lightning talk at
85Clojure West 2014 (unfortunately there is no video). See
86mal/clojurewest2014.mal for the presentation that was given at the
87conference (yes the presentation is a mal program).
60154d24 88
144f2b6a 89If you are interesting in creating a mal implementation (or just
bd62ff74 90interested in using mal for something), please drop by the #mal
144f2b6a
JM
91channel on freenode. In addition to the [make-a-lisp process
92guide](process/guide.md) there is also a [mal/make-a-lisp
93FAQ](docs/FAQ.md) where I attempt to answer some common questions.
94
60154d24
JM
95## Building/running implementations
96
5b207de7
JM
97The simplest way to run any given implementation is to use docker.
98Every implementation has a docker image pre-built with language
99dependencies installed. You can launch the REPL using a convenience
100target in the top level Makefile (where IMPL is the implementation
101directory name and stepX is the step to run):
102
103```
104make DOCKERIZE=1 "repl^IMPL^stepX"
105 # OR stepA is the default step:
106make DOCKERIZE=1 "repl^IMPL"
107```
108
109
8c7587af
MK
110### GNU awk
111
4c58cd4e 112*The GNU awk implementation was created by [Miutsuru kariya](https://github.com/kariya-mitsuru)*
390d5829 113
8c7587af
MK
114The GNU awk implementation of mal has been tested with GNU awk 4.1.1.
115
116```
117cd gawk
118gawk -O -f stepX_YYY.awk
119```
120
bcddc3e4 121### Bash 4
60154d24
JM
122
123```
124cd bash
125bash stepX_YYY.sh
126```
127
bcddc3e4 128### C
60154d24 129
01c97316
JM
130The C implementation of mal requires the following libraries (lib and
131header packages): glib, libffi6 and either the libedit or GNU readline library.
54c75382 132
60154d24
JM
133```
134cd c
135make
136./stepX_YYY
137```
138
73fc9366
JM
139### C++
140
a848d783
JM
141*The C++ implementation was created by [Stephen Thirlwall (sdt)](https://github.com/sdt)*
142
73fc9366
JM
143The C++ implementation of mal requires g++-4.9 or clang++-3.5 and
144a readline compatible library to build. See the `cpp/README.md` for
145more details:
146
147```
148cd cpp
149make
150 # OR
151make CXX=clang++-3.5
152./stepX_YYY
153```
154
155
9b1563a3 156### C# ###
edc3b064
JM
157
158The C# implementation of mal has been tested on Linux using the Mono
159C# compiler (mcs) and the Mono runtime (version 2.10.8.1). Both are
160required to build and run the C# implementation.
161
162```
163cd cs
164make
ee7cd585 165mono ./stepX_YYY.exe
edc3b064
JM
166```
167
168
bcddc3e4 169### Clojure
60154d24 170
aa716df6
JM
171For the most part the Clojure implementation requires Clojure 1.5,
172however, to pass all tests, Clojure 1.8.0-RC4 is required.
173
60154d24
JM
174```
175cd clojure
176lein with-profile +stepX trampoline run
177```
178
891c3f3b
JM
179### CoffeeScript
180
181```
182sudo npm install -g coffee-script
183cd coffee
184coffee ./stepX_YYY
185```
186
58b84dd5 187### Crystal
188
6427adea 189*The Crystal implementation of mal was created by [Linda_pp](https://github.com/rhysd)*
6c4dede1 190
d3ce5b49 191The Crystal implementation of mal has been tested with Crystal 0.10.0.
6c4dede1 192
58b84dd5 193```
194cd crystal
195crystal run ./stepX_YYY.cr
6c4dede1
JM
196 # OR
197make # needed to run tests
198./stepX_YYY
58b84dd5 199```
200
f82cb965
DM
201### D
202
203*The D implementation was created by [Dov Murik](https://github.com/dubek)*
204
205The D implementation of mal was tested with GDC 4.8. It requires the GNU
206readline library.
207
208```
209cd d
210make
211./stepX_YYY
212```
213
e0b7f668
VS
214### Emacs Lisp
215
216*The Emacs Lisp implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)*
217
218The Emacs Lisp implementation of mal has been tested with Emacs 24.3
219and 24.5. While there is very basic readline editing (`<backspace>`
220and `C-d` work, `C-c` cancels the process), it is recommended to use
221`rlwrap`.
222
223```
224cd elisp
225emacs -Q --batch --load stepX_YYY.el
226# with full readline support
227rlwrap emacs -Q --batch --load stepX_YYY.el
228```
229
bb526975 230### Elixir
231
232*The Elixir implementation was created by [Martin Ek (ekmartin)](https://github.com/ekmartin)*
233
234The Elixir implementation of mal has been tested with Elixir 1.0.5.
235
236```
237cd elixir
df2ca97b 238mix stepX_YYY
239# Or with readline/line editing functionality:
bb526975 240iex -S mix stepX_YYY
241```
242
2cc3804b
NF
243### Erlang
244
425ef3d7
JM
245*The Erlang implementation was created by [Nathan Fiedler (nlfiedler)](https://github.com/nlfiedler)*
246
82484631
JM
247The Erlang implementation of mal requires [Erlang/OTP R17](http://www.erlang.org/download.html)
248and [rebar](https://github.com/rebar/rebar) to build.
2cc3804b
NF
249
250```
251cd erlang
425ef3d7
JM
252make
253 # OR
254MAL_STEP=stepX_YYY rebar compile escriptize # build individual step
2cc3804b
NF
255./stepX_YYY
256```
257
88e934b6
JM
258### ES6 (ECMAScript 6 / ECMAScript 2015)
259
260The ES6 implementation uses the [babel](https://babeljs.io) compiler
261to generate ES5 compatible JavaScript. The generated code has been
262tested with Node 0.12.4.
263
264```
265cd es6
266make
267node build/stepX_YYY.js
268```
269
270
6f78381f
PS
271### F# ###
272
273*The F# implementation was created by [Peter Stephens (pstephens)](https://github.com/pstephens)*
274
275The F# implementation of mal has been tested on Linux using the Mono
276F# compiler (fsharpc) and the Mono runtime (version 3.12.1). The mono C#
206a1657 277compiler (mcs) is also necessary to compile the readline dependency. All are
6f78381f
PS
278required to build and run the F# implementation.
279
280```
281cd fsharp
282make
283mono ./stepX_YYY.exe
284```
285
5a53c643
JL
286### Factor
287
44c8a524 288*The Factor implementation was created by [Jordan Lewis (jordanlewis)](https://github.com/jordanlewis)*
5a53c643 289
0fe47e88
JM
290The Factor implementation of mal has been tested with Factor 0.97
291([factorcode.org](factorcode.org)).
292
5a53c643
JL
293```
294cd factor
199b1ce7 295FACTOR_ROOTS=. factor -run=stepX_YYY
5a53c643
JL
296```
297
96032890
C
298### Forth
299
a848d783
JM
300*The Forth implementation was created by [Chris Houser (chouser)](https://github.com/chouser)*
301
96032890
C
302```
303cd forth
304gforth stepX_YYY.fs
305```
306
1771ab50
JM
307### Go
308
0fe47e88 309The Go implementation of mal requires that go is installed on on the
fd888612
JM
310path. The implementation has been tested with Go 1.3.1.
311
1771ab50
JM
312```
313cd go
314make
315./stepX_YYY
316```
317
318
7ab0f63e
JM
319### Groovy
320
321The Groovy implementation of mal requires Groovy to run and has been
322tested with Groovy 1.8.6.
323
324```
325cd groovy
326make
327groovy ./stepX_YYY.groovy
328```
329
5a9cda80
JM
330### GNU Guile 2.1+
331
332*The Guile implementation was created by [Mu Lei (NalaGinrut)](https://github.com/NalaGinrut).*
333
334```
335cd guile
336guile -L ./ stepX_YYY.scm
337```
7ab0f63e 338
b76aa73b
JM
339### Haskell
340
2988d38e 341Install the Haskell compiler (ghc/ghci), the Haskell platform and
5400d4bf
JM
342either the editline package (BSD) or the readline package (GPL). On
343Ubuntu these packages are: ghc, haskell-platform,
344libghc-readline-dev/libghc-editline-dev
b76aa73b
JM
345
346```
347cd haskell
348make
349./stepX_YYY
350```
351
33dec7af
JM
352### Haxe
353
354The Haxe implementation of mal requires Haxe version 3.2 to compile.
355Four different Haxe targets are supported: Neko, Python, C++, and
356JavaScript.
357
358```
359cd haxe
360# Neko
361make all-neko
362neko ./stepX_YYY.n
363# Python
364make all-python
365python3 ./stepX_YYY.py
366# C++
367make all-cpp
368./cpp/stepX_YYY
369# JavaScript
370make all-js
371node ./stepX_YYY.js
372```
373
61f69fba
DM
374### Io
375
376*The Io implementation was created by [Dov Murik](https://github.com/dubek)*
377
378The Io implementation of mal has been tested with Io version 20110905.
379
380```
381cd io
382io ./stepX_YYY.io
383```
b76aa73b 384
bcddc3e4 385### Java 1.7
60154d24 386
01c97316
JM
387The Java implementation of mal requires maven2 to build.
388
60154d24
JM
389```
390cd java
391mvn compile
392mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY
393 # OR
394mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY -Dexec.args="CMDLINE_ARGS"
395```
396
39381792 397### JavaScript/Node
60154d24
JM
398
399```
400cd js
54c75382 401npm update
60154d24
JM
402node stepX_YYY.js
403```
404
39381792
JM
405### Julia
406
82484631 407The Julia implementation of mal requires Julia 0.4.
39381792
JM
408
409```
410cd julia
411julia stepX_YYY.jl
412```
413
53c2ea70
JFI
414### Kotlin
415
416*The Kotlin implementation was created by [Javier Fernandez-Ivern](https://github.com/ivern)*
417
75787d77 418The Kotlin implementation of mal has been tested with Kotlin 1.0.
53c2ea70
JFI
419
420```
421cd kotlin
422make
423java -jar stepX_YYY.jar
424```
425
9d42904e
JM
426### Lua
427
8a9d0a8a 428Running the Lua implementation of mal requires lua 5.1 or later,
9d42904e
JM
429luarocks and the lua-rex-pcre library installed.
430
431```
432cd lua
433make # to build and link linenoise.so
434./stepX_YYY.lua
435```
436
bcddc3e4 437### Mal
60154d24
JM
438
439Running the mal implementation of mal involves running stepA of one of
440the other implementations and passing the mal step to run as a command
5d446bd8 441line argument.
60154d24
JM
442
443```
444cd IMPL
445IMPL_STEPA_CMD ../mal/stepX_YYY.mal
446
447```
448
bcddc3e4 449### GNU Make 3.81
60154d24
JM
450
451```
452cd make
453make -f stepX_YYY.mk
454```
455
de69b639 456### Nim 0.11.0
a2cd0a3a 457
a848d783
JM
458*The Nim implementation was created by [Dennis Felsing (def-)](https://github.com/def-)*
459
de69b639 460Running the Nim implementation of mal requires Nim 0.11.0 or later.
a2cd0a3a 461
462```
463cd nim
464make
465 # OR
466nimble build
467./stepX_YYY
468```
469
0067158f
JM
470### Object Pascal
471
472The Object Pascal implementation of mal has been built and tested on
473Linux using the Free Pascal compiler version 2.6.2 and 2.6.4.
474
475```
476cd objpascal
477make
478./stepX_YYY
479```
480
7cae6e6f
JM
481### Objective C
482
483The Objective C implementation of mal has been built and tested on
2faae94c
JM
484Linux using clang/LLVM 3.6. It has also been built and tested on OS
485X using XCode 7.
7cae6e6f
JM
486
487```
488cd objc
489make
490./stepX_YYY
491```
492
bc6448bc
C
493### OCaml 4.01.0
494
a848d783
JM
495*The OCaml implementation was created by [Chris Houser (chouser)](https://github.com/chouser)*
496
bc6448bc
C
497```
498cd ocaml
499make
500./stepX_YYY
501```
502
8a9d0a8a
JM
503### MATLAB
504
505The MATLAB implementation of mal has been tested with MATLAB version
506R2014a on Linux. Note that MATLAB is a commercial product. It should
507be fairly simple to support GNU Octave once it support classdef object
508syntax.
509
510```
511cd matlab
512./stepX_YYY
513matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY();quit;"
514 # OR with command line arguments
515matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY('arg1','arg2');quit;"
516```
517
1218ce98
JM
518### miniMAL
519
520[miniMAL](https://github.com/kanaka/miniMAL) is small Lisp interpreter
521implemented in less than 1024 bytes of JavaScript. To run the miniMAL
522implementation of mal you need to download/install the miniMAL
523interpreter (which requires Node.js).
524```
1218ce98 525cd miniMAL
478fd9ce
JM
526# Download miniMAL and dependencies
527npm install
528export PATH=`pwd`/node_modules/minimal-lisp/:$PATH
529# Now run mal implementation in miniMAL
1218ce98
JM
530miniMAL ./stepX_YYY
531```
532
9b1563a3 533### Perl 5.8
9e5b2151
JM
534
535For readline line editing support, install Term::ReadLine::Perl or
536Term::ReadLine::Gnu from CPAN.
537
538```
539cd perl
540perl stepX_YYY.pl
541```
542
543
bcddc3e4 544### PHP 5.3
60154d24 545
01c97316
JM
546The PHP implementation of mal requires the php command line interface
547to run.
548
60154d24
JM
549```
550cd php
551php stepX_YYY.php
552```
553
bcddc3e4 554### Postscript Level 2/3
60154d24 555
01c97316
JM
556The Postscript implementation of mal requires ghostscript to run. It
557has been tested with ghostscript 9.10.
558
60154d24
JM
559```
560cd ps
fa64b741 561gs -q -dNODISPLAY -I./ stepX_YYY.ps
60154d24
JM
562```
563
23e38cd2 564### Python (2.X or 3.X)
60154d24
JM
565
566```
567cd python
568python stepX_YYY.py
569```
8adb0827 570
23e38cd2
JM
571### RPython
572
573You must have [rpython](https://rpython.readthedocs.org/) on your path
574(included with [pypy](https://bitbucket.org/pypy/pypy/)).
575
576```
577cd rpython
4e8d7c28 578make # this takes a very long time
23e38cd2
JM
579./stepX_YYY
580```
581
9b3362e8
JM
582### R
583
584The R implementation of mal requires R (r-base-core) to run.
585
586```
587cd r
9d42904e 588make libs # to download and build rdyncall
f5223195
JM
589Rscript stepX_YYY.r
590```
591
592### Racket (5.3)
593
594The Racket implementation of mal requires the Racket
595compiler/interpreter to run.
596
597```
598cd racket
3796240a 599./stepX_YYY.rkt
9b3362e8
JM
600```
601
107d9694 602### Ruby (1.9+)
8adb0827
JM
603
604```
605cd ruby
606ruby stepX_YYY.rb
607```
592eb5cf 608
9106a221 609### Rust (1.0.0 nightly)
abdd56eb
JM
610
611The rust implementation of mal requires the rust compiler and build
612tool (cargo) to build.
613
614```
615cd rust
bbeb1b87 616cargo run --release --bin stepX_YYY
abdd56eb
JM
617```
618
821930db
JM
619### Scala ###
620
621Install scala and sbt (http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html):
622
623```
624cd scala
625sbt 'run-main stepX_YYY'
626 # OR
627sbt compile
628scala -classpath target/scala*/classes stepX_YYY
629```
630
2539e6af
KR
631### Swift
632
a848d783
JM
633*The Swift implementation was created by [Keith Rollin](https://github.com/keith-rollin)*
634
e31349f6
KR
635The Swift implementation of mal requires the Swift 2.0 compiler (XCode
6367.0) to build. Older versions will not work due to changes in the
637language and standard library.
8b142f08 638
2539e6af
KR
639```
640cd swift
641make
642./stepX_YYY
643```
644
ea1395aa
JM
645### Swift 3
646
647The Swift 3 implementation of mal requires the Swift 3.0 compiler. It
648has been tested with the development version of the Swift 3 from
6492016-02-08.
650
651```
652cd swift3
653make
654./stepX_YYY
655```
656
54d9903c
DM
657### Tcl 8.6
658
659*The Tcl implementation was created by [Dov Murik](https://github.com/dubek)*
660
661The Tcl implementation of mal requires Tcl 8.6 to run. For readline line
662editing support, install tclreadline.
663
664```
665cd tcl
666tclsh ./stepX_YYY.tcl
667```
668
50a964ce
DM
669### Vimscript
670
671*The Vimscript implementation was created by [Dov Murik](https://github.com/dubek)*
672
673The Vimscript implementation of mal requires Vim to run. It has been tested
674with Vim 7.4.
675
676```
677cd vimscript
678./run_vimscript.sh ./stepX_YYY.vim
679```
680
ee7cd585
JM
681### Visual Basic.NET ###
682
683The VB.NET implementation of mal has been tested on Linux using the Mono
684VB compiler (vbnc) and the Mono runtime (version 2.10.8.1). Both are
685required to build and run the VB.NET implementation.
686
687```
688cd vb
689make
690mono ./stepX_YYY.exe
691```
692
693
694
592eb5cf
JM
695## Running tests
696
294aba2c
JM
697### Functional tests
698
eaa6ceb4 699The are over 600 generic functional tests (for all implementations)
294aba2c
JM
700in the `tests/` directory. Each step has a corresponding test file
701containing tests specific to that step. The `runtest.py` test harness
bd62ff74
JM
702launches a Mal step implementation and then feeds the tests one at
703a time to the implementation and compares the output/return value to
704the expected output/return value.
592eb5cf
JM
705
706To simplify the process of running tests, a top level Makefile is
707provided with convenient test targets.
708
709* To run all the tests across all implementations (be prepared to wait):
710
711```
712make test
713```
714
715* To run all tests against a single implementation:
716
717```
e5737b08 718make "test^IMPL"
592eb5cf
JM
719
720# e.g.
e5737b08
SL
721make "test^clojure"
722make "test^js"
592eb5cf
JM
723```
724
725* To run tests for a single step against all implementations:
726
727```
e5737b08 728make "test^stepX"
592eb5cf
JM
729
730# e.g.
e5737b08
SL
731make "test^step2"
732make "test^step7"
592eb5cf
JM
733```
734
4c58cd4e 735* To run tests for a specific step against a single implementation:
592eb5cf
JM
736
737```
e5737b08 738make "test^IMPL^stepX"
592eb5cf
JM
739
740# e.g
e5737b08
SL
741make "test^ruby^step3"
742make "test^ps^step4"
592eb5cf 743```
fd888612 744
294aba2c
JM
745### Self-hosted functional tests
746
747* To run the functional tests in self-hosted mode, you specify `mal`
748 as the test implementation and use the `MAL_IMPL` make variable
749 to change the underlying host language (default is JavaScript):
750```
e5737b08 751make MAL_IMPL=IMPL "test^mal^step2"
294aba2c
JM
752
753# e.g.
e5737b08
SL
754make "test^mal^step2" # js is default
755make MAL_IMPL=ruby "test^mal^step2"
756make MAL_IMPL=python "test^mal^step2"
294aba2c
JM
757```
758
854cf2a6
DM
759### Starting the REPL
760
761* To start the REPL of an implementation in a specific step:
762
763```
764make "repl^IMPL^stepX"
765
766# e.g
767make "repl^ruby^step3"
768make "repl^ps^step4"
769```
770
771* If you omit the step, then `stepA` is used:
772
773```
774make "repl^IMPL"
775
776# e.g
777make "repl^ruby"
778make "repl^ps"
779```
780
781* To start the REPL of the self-hosted implementation, specify `mal` as the
782 REPL implementation and use the `MAL_IMPL` make variable to change the
783 underlying host language (default is JavaScript):
784```
785make MAL_IMPL=IMPL "repl^mal^stepX"
786
787# e.g.
788make "repl^mal^step2" # js is default
789make MAL_IMPL=ruby "repl^mal^step2"
790make MAL_IMPL=python "repl^mal"
791```
294aba2c
JM
792
793### Performance tests
794
8569b2af
JM
795Warning: These performance tests are neither statistically valid nor
796comprehensive; runtime performance is a not a primary goal of mal. If
797you draw any serious conclusions from these performance tests, then
798please contact me about some amazing oceanfront property in Kansas
799that I'm willing to sell you for cheap.
800
294aba2c
JM
801* To run performance tests against a single implementation:
802```
e5737b08 803make "perf^IMPL"
294aba2c
JM
804
805# e.g.
e5737b08 806make "perf^js"
294aba2c
JM
807```
808
809* To run performance tests against all implementations:
810```
e5737b08 811make "perf"
294aba2c
JM
812```
813
814### Generating language statistics
815
4c58cd4e 816* To report line and byte statistics for a single implementation:
294aba2c 817```
e5737b08 818make "stats^IMPL"
294aba2c
JM
819
820# e.g.
e5737b08 821make "stats^js"
294aba2c
JM
822```
823
4c58cd4e 824* To report line and bytes statistics for general Lisp code (env, core
294aba2c
JM
825 and stepA):
826```
e5737b08 827make "stats-lisp^IMPL"
294aba2c
JM
828
829# e.g.
e5737b08 830make "stats-lisp^js"
294aba2c
JM
831```
832
5b207de7 833## Dockerized testing
75363567 834
5b207de7
JM
835Every implementation directory contains a Dockerfile to create
836a docker image containing all the dependencies for that
837implementation. In addition, the top-level Makefile contains support
838for running the tests target (and perf, stats, repl, etc) within
839a docker container for that implementation by passing *"DOCKERIZE=1"*
840on the make command line. For example:
75363567 841
75363567 842```
5b207de7 843make DOCKERIZE=1 "test^js^step3"
75363567
JM
844```
845
5b207de7
JM
846Existing implementations already have docker images built and pushed
847to the docker registry. However, if
848you wish to build or rebuild a docker image locally, the toplevel
849Makefile provides a rule for building docker images:
850
75363567 851```
5b207de7
JM
852make "docker-build^IMPL"
853```
854
75363567
JM
855
856**Notes**:
5b207de7
JM
857* Docker images are named *"kanaka/mal-test-IMPL"*
858* JVM-based language implementations (Groovy, Java, Clojure, Scala):
859 you will probably need to run these implementations once manually
860 first (make DOCKERIZE=1 "repl^IMPL")before you can run tests because
861 runtime dependencies need to be downloaded to avoid the tests timing
862 out. These dependencies are download to dot-files in the /mal
863 directory so they will persist between runs.
75363567 864
294aba2c 865
fd888612
JM
866## License
867
868Mal (make-a-lisp) is licensed under the MPL 2.0 (Mozilla Public
869License 2.0). See LICENSE.txt for more details.