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