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