Commit | Line | Data |
---|---|---|
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 | 7 | Mal is a Clojure inspired Lisp interpreter. |
b76aa73b | 8 | |
918f2bee | 9 | Mal is implemented in 72 languages: |
bcddc3e4 | 10 | |
6faafa00 | 11 | * Ada |
8c7587af | 12 | * GNU awk |
edc3b064 | 13 | * Bash shell |
2bcc46af | 14 | * BASIC (C64 and QBasic) |
bcddc3e4 | 15 | * C |
73fc9366 | 16 | * C++ |
edc3b064 | 17 | * C# |
385a08eb | 18 | * ChucK |
e7f85ce1 | 19 | * Common Lisp |
2d76e877 | 20 | * Clojure (Clojure and ClojureScript) |
891c3f3b | 21 | * CoffeeScript |
6c4dede1 | 22 | * Crystal |
f82cb965 | 23 | * D |
bcf95720 | 24 | * Dart |
bb526975 | 25 | * Elixir |
f38c7ffa | 26 | * Elm |
e0b7f668 | 27 | * Emacs Lisp |
2cc3804b | 28 | * Erlang |
88e934b6 | 29 | * ES6 (ECMAScript 6 / ECMAScript 2015) |
6f78381f | 30 | * F# |
0fe47e88 | 31 | * Factor |
96032890 | 32 | * Forth |
1771ab50 | 33 | * Go |
7ab0f63e | 34 | * Groovy |
7c6882f2 | 35 | * GNU Guile |
9592d833 | 36 | * GNU Smalltalk |
b76aa73b | 37 | * Haskell |
2d76e877 | 38 | * Haxe (Neko, Python, C++ and JavaScript) |
ccab8f59 | 39 | * Hy |
61f69fba | 40 | * Io |
bcddc3e4 | 41 | * Java |
39381792 JM |
42 | * JavaScript ([Online Demo](http://kanaka.github.io/mal)) |
43 | * Julia | |
53c2ea70 | 44 | * Kotlin |
0af8fd20 | 45 | * LiveScript |
4eb88ef2 | 46 | * Logo |
9d42904e | 47 | * Lua |
bcddc3e4 JM |
48 | * GNU Make |
49 | * mal itself | |
4bb2ab37 | 50 | * Matlab (GNU Octave and MATLAB) |
1218ce98 | 51 | * [miniMAL](https://github.com/kanaka/miniMAL) |
331ddfed | 52 | * NASM |
a2cd0a3a | 53 | * Nim |
0067158f | 54 | * Object Pascal |
7cae6e6f | 55 | * Objective C |
bc6448bc | 56 | * OCaml |
6301e0b6 | 57 | * Perl |
a7081401 | 58 | * Perl 6 |
edc3b064 | 59 | * PHP |
b6263859 | 60 | * Picolisp |
b88bb764 JM |
61 | * PL/pgSQL (Postgres) |
62 | * PL/SQL (Oracle) | |
edc3b064 | 63 | * Postscript |
5c34565f | 64 | * PowerShell |
2d76e877 | 65 | * Python (2.X and 3.X) |
23e38cd2 | 66 | * RPython |
9b3362e8 | 67 | * R |
f5223195 | 68 | * Racket |
44a3e2ef | 69 | * Rexx |
8adb0827 | 70 | * Ruby |
abdd56eb | 71 | * Rust |
821930db | 72 | * Scala |
ff3a8bf8 | 73 | * Scheme (R7RS) |
034e82ad | 74 | * Skew |
8b142f08 | 75 | * Swift |
ea1395aa | 76 | * Swift 3 |
54d9903c | 77 | * Tcl |
db885df9 | 78 | * TypeScript |
36e91db4 | 79 | * VHDL |
50a964ce | 80 | * Vimscript |
ee7cd585 | 81 | * Visual Basic.NET |
a3665311 | 82 | * Yorick |
bcddc3e4 JM |
83 | |
84 | ||
bd08422d JM |
85 | Mal is a learning tool. See the [make-a-lisp process |
86 | guide](process/guide.md). Each implementation of mal is separated into | |
87 | 11 incremental, self-contained (and testable) steps that demonstrate | |
88 | core concepts of Lisp. The last step is capable of self-hosting | |
89 | (running the mal implementation of mal). | |
bcddc3e4 JM |
90 | |
91 | The mal (make a lisp) steps are: | |
92 | ||
0f4ca9d1 JM |
93 | * [step0_repl](process/guide.md#step0) |
94 | * [step1_read_print](process/guide.md#step1) | |
95 | * [step2_eval](process/guide.md#step2) | |
96 | * [step3_env](process/guide.md#step3) | |
97 | * [step4_if_fn_do](process/guide.md#step4) | |
98 | * [step5_tco](process/guide.md#step5) | |
99 | * [step6_file](process/guide.md#step6) | |
100 | * [step7_quote](process/guide.md#step7) | |
101 | * [step8_macros](process/guide.md#step8) | |
102 | * [step9_try](process/guide.md#step9) | |
90f618cb | 103 | * [stepA_mal](process/guide.md#stepA) |
bcddc3e4 JM |
104 | |
105 | ||
106 | Mal was presented publicly for the first time in a lightning talk at | |
107 | Clojure West 2014 (unfortunately there is no video). See | |
dede32ba JM |
108 | examples/clojurewest2014.mal for the presentation that was given at the |
109 | conference (yes the presentation is a mal program). At Midwest.io | |
110 | 2015, Joel Martin gave a presentation on Mal titled "Achievement | |
111 | Unlocked: A Better Path to Language Learning". | |
112 | [Video](https://www.youtube.com/watch?v=lgyOAiRtZGw), | |
9ed75afd JM |
113 | [Slides](http://kanaka.github.io/midwest.io.mal/). More recently |
114 | Joel gave a presentation on "Make Your Own Lisp Interpreter in | |
115 | 10 Incremental Steps" at LambdaConf 2016: [Part | |
116 | 1](https://www.youtube.com/watch?v=jVhupfthTEk), [Part | |
117 | 2](https://www.youtube.com/watch?v=X5OQBMGpaTU), | |
118 | [Slides](http://kanaka.github.io/lambdaconf/). | |
60154d24 | 119 | |
144f2b6a | 120 | If you are interesting in creating a mal implementation (or just |
bd62ff74 | 121 | interested in using mal for something), please drop by the #mal |
144f2b6a JM |
122 | channel on freenode. In addition to the [make-a-lisp process |
123 | guide](process/guide.md) there is also a [mal/make-a-lisp | |
124 | FAQ](docs/FAQ.md) where I attempt to answer some common questions. | |
125 | ||
60154d24 JM |
126 | ## Building/running implementations |
127 | ||
5b207de7 JM |
128 | The simplest way to run any given implementation is to use docker. |
129 | Every implementation has a docker image pre-built with language | |
130 | dependencies installed. You can launch the REPL using a convenience | |
131 | target in the top level Makefile (where IMPL is the implementation | |
132 | directory name and stepX is the step to run): | |
133 | ||
134 | ``` | |
135 | make DOCKERIZE=1 "repl^IMPL^stepX" | |
136 | # OR stepA is the default step: | |
137 | make DOCKERIZE=1 "repl^IMPL" | |
138 | ``` | |
139 | ||
140 | ||
6faafa00 CM |
141 | ### Ada |
142 | ||
7b458a65 JM |
143 | *The Ada implementation was created by [Chris Moore](https://github.com/zmower)* |
144 | ||
145 | The Ada implementation was developed with GNAT 4.9 on debian. It also | |
146 | compiles unchanged on windows if you have windows versions of git, | |
147 | GNAT and (optionally) make. There are no external dependencies | |
148 | (readline not implemented). | |
6faafa00 CM |
149 | |
150 | ``` | |
151 | cd ada | |
152 | make | |
153 | ./stepX_YYY | |
154 | ``` | |
155 | ||
8c7587af MK |
156 | ### GNU awk |
157 | ||
4c58cd4e | 158 | *The GNU awk implementation was created by [Miutsuru kariya](https://github.com/kariya-mitsuru)* |
390d5829 | 159 | |
8c7587af MK |
160 | The GNU awk implementation of mal has been tested with GNU awk 4.1.1. |
161 | ||
162 | ``` | |
163 | cd gawk | |
164 | gawk -O -f stepX_YYY.awk | |
165 | ``` | |
166 | ||
bcddc3e4 | 167 | ### Bash 4 |
60154d24 JM |
168 | |
169 | ``` | |
170 | cd bash | |
171 | bash stepX_YYY.sh | |
172 | ``` | |
173 | ||
2bcc46af | 174 | ### BASIC (C64 and QBasic) |
1b245300 | 175 | |
2bcc46af JM |
176 | The BASIC implementation uses a preprocessor that can generate BASIC |
177 | code that is compatible with both C64 BASIC (CBM v2) and QBasic. The | |
1b245300 JM |
178 | C64 mode has been tested with |
179 | [cbmbasic](https://github.com/kanaka/cbmbasic) (the patched version is | |
180 | currently required to fix issues with line input) and the QBasic mode | |
181 | has been tested with [qb64](http://www.qb64.net/). | |
182 | ||
183 | Generate C64 code and run it using cbmbasic: | |
184 | ||
185 | ``` | |
186 | cd basic | |
187 | make stepX_YYY.bas | |
188 | STEP=stepX_YYY ./run | |
189 | ``` | |
190 | ||
191 | Generate QBasic code and load it into qb64: | |
192 | ||
193 | ``` | |
194 | cd basic | |
195 | make MODE=qbasic stepX_YYY.bas | |
196 | ./qb64 stepX_YYY.bas | |
197 | ``` | |
198 | ||
199 | Thanks to [Steven Syrek](https://github.com/sjsyrek) for the original | |
200 | inspiration for this implementation. | |
201 | ||
202 | ||
bcddc3e4 | 203 | ### C |
60154d24 | 204 | |
01c97316 | 205 | The C implementation of mal requires the following libraries (lib and |
6b3ecaa7 DM |
206 | header packages): glib, libffi6, libgc, and either the libedit or GNU readline |
207 | library. | |
54c75382 | 208 | |
60154d24 JM |
209 | ``` |
210 | cd c | |
211 | make | |
212 | ./stepX_YYY | |
213 | ``` | |
214 | ||
73fc9366 JM |
215 | ### C++ |
216 | ||
a848d783 JM |
217 | *The C++ implementation was created by [Stephen Thirlwall (sdt)](https://github.com/sdt)* |
218 | ||
73fc9366 JM |
219 | The C++ implementation of mal requires g++-4.9 or clang++-3.5 and |
220 | a readline compatible library to build. See the `cpp/README.md` for | |
221 | more details: | |
222 | ||
223 | ``` | |
224 | cd cpp | |
225 | make | |
226 | # OR | |
227 | make CXX=clang++-3.5 | |
228 | ./stepX_YYY | |
229 | ``` | |
230 | ||
231 | ||
9b1563a3 | 232 | ### C# ### |
edc3b064 JM |
233 | |
234 | The C# implementation of mal has been tested on Linux using the Mono | |
235 | C# compiler (mcs) and the Mono runtime (version 2.10.8.1). Both are | |
236 | required to build and run the C# implementation. | |
237 | ||
238 | ``` | |
239 | cd cs | |
240 | make | |
ee7cd585 | 241 | mono ./stepX_YYY.exe |
edc3b064 JM |
242 | ``` |
243 | ||
385a08eb VS |
244 | ### ChucK |
245 | ||
246 | *The ChucK implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)* | |
247 | ||
332611f5 | 248 | The ChucK implementation has been tested with ChucK 1.3.5.2. |
385a08eb VS |
249 | |
250 | ``` | |
251 | cd chuck | |
252 | ./run | |
253 | ``` | |
edc3b064 | 254 | |
e7f85ce1 | 255 | ### Common Lisp |
b0e08374 | 256 | |
e7f85ce1 | 257 | *The Common Lisp implementation was created by [Iqbal Ansari](https://github.com/iqbalansari)* |
b0e08374 | 258 | |
e7f85ce1 IA |
259 | The implementation has been tested with SBCL, CCL, CMUCL, GNU CLISP, ECL and |
260 | Allegro CL on Ubuntu 16.04 and Ubuntu 12.04, see | |
261 | the [README][common-lisp/README.org] for more details. Provided you have the | |
262 | dependencies mentioned installed, do the following to run the implementation | |
b0e08374 IA |
263 | |
264 | ``` | |
e7f85ce1 | 265 | cd common-lisp |
b0e08374 IA |
266 | make |
267 | ./run | |
268 | ``` | |
269 | ||
bcddc3e4 | 270 | ### Clojure |
60154d24 | 271 | |
aa716df6 JM |
272 | For the most part the Clojure implementation requires Clojure 1.5, |
273 | however, to pass all tests, Clojure 1.8.0-RC4 is required. | |
274 | ||
60154d24 JM |
275 | ``` |
276 | cd clojure | |
277 | lein with-profile +stepX trampoline run | |
278 | ``` | |
279 | ||
891c3f3b JM |
280 | ### CoffeeScript |
281 | ||
282 | ``` | |
283 | sudo npm install -g coffee-script | |
284 | cd coffee | |
285 | coffee ./stepX_YYY | |
286 | ``` | |
287 | ||
58b84dd5 | 288 | ### Crystal |
289 | ||
6427adea | 290 | *The Crystal implementation of mal was created by [Linda_pp](https://github.com/rhysd)* |
6c4dede1 | 291 | |
d10848bb | 292 | The Crystal implementation of mal has been tested with Crystal 0.18.4. |
6c4dede1 | 293 | |
58b84dd5 | 294 | ``` |
295 | cd crystal | |
296 | crystal run ./stepX_YYY.cr | |
6c4dede1 JM |
297 | # OR |
298 | make # needed to run tests | |
299 | ./stepX_YYY | |
58b84dd5 | 300 | ``` |
301 | ||
f82cb965 DM |
302 | ### D |
303 | ||
304 | *The D implementation was created by [Dov Murik](https://github.com/dubek)* | |
305 | ||
306 | The D implementation of mal was tested with GDC 4.8. It requires the GNU | |
307 | readline library. | |
308 | ||
309 | ``` | |
310 | cd d | |
311 | make | |
312 | ./stepX_YYY | |
313 | ``` | |
314 | ||
bcf95720 HT |
315 | ### Dart |
316 | ||
317 | *The Dart implementation was created by [Harry Terkelsen](https://github.com/hterkelsen)* | |
318 | ||
319 | The Dart implementation has been tested with Dart 1.20. | |
320 | ||
321 | ``` | |
322 | cd dart | |
323 | dart ./stepX_YYY | |
324 | ``` | |
325 | ||
e0b7f668 VS |
326 | ### Emacs Lisp |
327 | ||
328 | *The Emacs Lisp implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)* | |
329 | ||
330 | The Emacs Lisp implementation of mal has been tested with Emacs 24.3 | |
331 | and 24.5. While there is very basic readline editing (`<backspace>` | |
332 | and `C-d` work, `C-c` cancels the process), it is recommended to use | |
333 | `rlwrap`. | |
334 | ||
335 | ``` | |
336 | cd elisp | |
337 | emacs -Q --batch --load stepX_YYY.el | |
338 | # with full readline support | |
339 | rlwrap emacs -Q --batch --load stepX_YYY.el | |
340 | ``` | |
341 | ||
bb526975 | 342 | ### Elixir |
343 | ||
344 | *The Elixir implementation was created by [Martin Ek (ekmartin)](https://github.com/ekmartin)* | |
345 | ||
346 | The Elixir implementation of mal has been tested with Elixir 1.0.5. | |
347 | ||
348 | ``` | |
349 | cd elixir | |
df2ca97b | 350 | mix stepX_YYY |
351 | # Or with readline/line editing functionality: | |
bb526975 | 352 | iex -S mix stepX_YYY |
353 | ``` | |
354 | ||
f38c7ffa JB |
355 | ### Elm |
356 | ||
357 | *The Elm implementation was created by [Jos van Bakel](https://github.com/c0deaddict)* | |
358 | ||
359 | The Elm implementation of mal has been tested with Elm 0.18.0 | |
360 | ||
361 | ``` | |
362 | cd elm | |
363 | make stepX_YYY.js | |
364 | STEP=stepX_YYY ./run | |
365 | ``` | |
366 | ||
2cc3804b NF |
367 | ### Erlang |
368 | ||
425ef3d7 JM |
369 | *The Erlang implementation was created by [Nathan Fiedler (nlfiedler)](https://github.com/nlfiedler)* |
370 | ||
82484631 JM |
371 | The Erlang implementation of mal requires [Erlang/OTP R17](http://www.erlang.org/download.html) |
372 | and [rebar](https://github.com/rebar/rebar) to build. | |
2cc3804b NF |
373 | |
374 | ``` | |
375 | cd erlang | |
425ef3d7 JM |
376 | make |
377 | # OR | |
378 | MAL_STEP=stepX_YYY rebar compile escriptize # build individual step | |
2cc3804b NF |
379 | ./stepX_YYY |
380 | ``` | |
381 | ||
88e934b6 JM |
382 | ### ES6 (ECMAScript 6 / ECMAScript 2015) |
383 | ||
384 | The ES6 implementation uses the [babel](https://babeljs.io) compiler | |
385 | to generate ES5 compatible JavaScript. The generated code has been | |
386 | tested with Node 0.12.4. | |
387 | ||
388 | ``` | |
389 | cd es6 | |
390 | make | |
391 | node build/stepX_YYY.js | |
392 | ``` | |
393 | ||
394 | ||
6f78381f PS |
395 | ### F# ### |
396 | ||
397 | *The F# implementation was created by [Peter Stephens (pstephens)](https://github.com/pstephens)* | |
398 | ||
399 | The F# implementation of mal has been tested on Linux using the Mono | |
400 | F# compiler (fsharpc) and the Mono runtime (version 3.12.1). The mono C# | |
206a1657 | 401 | compiler (mcs) is also necessary to compile the readline dependency. All are |
6f78381f PS |
402 | required to build and run the F# implementation. |
403 | ||
404 | ``` | |
405 | cd fsharp | |
406 | make | |
407 | mono ./stepX_YYY.exe | |
408 | ``` | |
409 | ||
5a53c643 JL |
410 | ### Factor |
411 | ||
44c8a524 | 412 | *The Factor implementation was created by [Jordan Lewis (jordanlewis)](https://github.com/jordanlewis)* |
5a53c643 | 413 | |
0fe47e88 | 414 | The Factor implementation of mal has been tested with Factor 0.97 |
07eb827b | 415 | ([factorcode.org](http://factorcode.org)). |
0fe47e88 | 416 | |
5a53c643 JL |
417 | ``` |
418 | cd factor | |
199b1ce7 | 419 | FACTOR_ROOTS=. factor -run=stepX_YYY |
5a53c643 JL |
420 | ``` |
421 | ||
96032890 C |
422 | ### Forth |
423 | ||
a848d783 JM |
424 | *The Forth implementation was created by [Chris Houser (chouser)](https://github.com/chouser)* |
425 | ||
96032890 C |
426 | ``` |
427 | cd forth | |
428 | gforth stepX_YYY.fs | |
429 | ``` | |
430 | ||
1771ab50 JM |
431 | ### Go |
432 | ||
0fe47e88 | 433 | The Go implementation of mal requires that go is installed on on the |
fd888612 JM |
434 | path. The implementation has been tested with Go 1.3.1. |
435 | ||
1771ab50 JM |
436 | ``` |
437 | cd go | |
438 | make | |
439 | ./stepX_YYY | |
440 | ``` | |
441 | ||
442 | ||
7ab0f63e JM |
443 | ### Groovy |
444 | ||
445 | The Groovy implementation of mal requires Groovy to run and has been | |
446 | tested with Groovy 1.8.6. | |
447 | ||
448 | ``` | |
449 | cd groovy | |
450 | make | |
451 | groovy ./stepX_YYY.groovy | |
452 | ``` | |
453 | ||
5a9cda80 JM |
454 | ### GNU Guile 2.1+ |
455 | ||
456 | *The Guile implementation was created by [Mu Lei (NalaGinrut)](https://github.com/NalaGinrut).* | |
457 | ||
458 | ``` | |
459 | cd guile | |
460 | guile -L ./ stepX_YYY.scm | |
461 | ``` | |
7ab0f63e | 462 | |
9592d833 VS |
463 | ### GNU Smalltalk |
464 | ||
465 | *The Smalltalk implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)* | |
466 | ||
467 | The Smalltalk implementation of mal has been tested with GNU Smalltalk 3.2.91. | |
468 | ||
469 | ``` | |
470 | cd gst | |
471 | ./run | |
472 | ``` | |
473 | ||
b76aa73b JM |
474 | ### Haskell |
475 | ||
f60f33e0 JM |
476 | The Haskell implementation requires the ghc compiler version 7.10.1 or |
477 | later and also the Haskell parsec and readline (or editline) packages. | |
b76aa73b JM |
478 | |
479 | ``` | |
480 | cd haskell | |
481 | make | |
482 | ./stepX_YYY | |
483 | ``` | |
484 | ||
2d76e877 | 485 | ### Haxe (Neko, Python, C++ and JavaScript) |
33dec7af JM |
486 | |
487 | The Haxe implementation of mal requires Haxe version 3.2 to compile. | |
488 | Four different Haxe targets are supported: Neko, Python, C++, and | |
489 | JavaScript. | |
490 | ||
491 | ``` | |
492 | cd haxe | |
493 | # Neko | |
494 | make all-neko | |
495 | neko ./stepX_YYY.n | |
496 | # Python | |
497 | make all-python | |
498 | python3 ./stepX_YYY.py | |
499 | # C++ | |
500 | make all-cpp | |
501 | ./cpp/stepX_YYY | |
502 | # JavaScript | |
503 | make all-js | |
504 | node ./stepX_YYY.js | |
505 | ``` | |
506 | ||
ccab8f59 JM |
507 | ### Hy |
508 | ||
509 | The Hy implementation of mal has been tested with Hy 0.13.0. | |
510 | ||
511 | ``` | |
512 | cd hy | |
513 | ./stepX_YYY.hy | |
514 | ``` | |
515 | ||
61f69fba DM |
516 | ### Io |
517 | ||
518 | *The Io implementation was created by [Dov Murik](https://github.com/dubek)* | |
519 | ||
520 | The Io implementation of mal has been tested with Io version 20110905. | |
521 | ||
522 | ``` | |
523 | cd io | |
524 | io ./stepX_YYY.io | |
525 | ``` | |
b76aa73b | 526 | |
bcddc3e4 | 527 | ### Java 1.7 |
60154d24 | 528 | |
01c97316 JM |
529 | The Java implementation of mal requires maven2 to build. |
530 | ||
60154d24 JM |
531 | ``` |
532 | cd java | |
533 | mvn compile | |
534 | mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY | |
535 | # OR | |
536 | mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY -Dexec.args="CMDLINE_ARGS" | |
537 | ``` | |
538 | ||
39381792 | 539 | ### JavaScript/Node |
60154d24 JM |
540 | |
541 | ``` | |
542 | cd js | |
54c75382 | 543 | npm update |
60154d24 JM |
544 | node stepX_YYY.js |
545 | ``` | |
546 | ||
39381792 JM |
547 | ### Julia |
548 | ||
82484631 | 549 | The Julia implementation of mal requires Julia 0.4. |
39381792 JM |
550 | |
551 | ``` | |
552 | cd julia | |
553 | julia stepX_YYY.jl | |
554 | ``` | |
555 | ||
53c2ea70 JFI |
556 | ### Kotlin |
557 | ||
558 | *The Kotlin implementation was created by [Javier Fernandez-Ivern](https://github.com/ivern)* | |
559 | ||
75787d77 | 560 | The Kotlin implementation of mal has been tested with Kotlin 1.0. |
53c2ea70 JFI |
561 | |
562 | ``` | |
563 | cd kotlin | |
564 | make | |
565 | java -jar stepX_YYY.jar | |
566 | ``` | |
567 | ||
0af8fd20 JB |
568 | ### LiveScript |
569 | ||
570 | *The LiveScript implementation was created by [Jos van Bakel](https://github.com/c0deaddict)* | |
571 | ||
572 | The LiveScript implementation of mal has been tested with LiveScript 1.5. | |
573 | ||
574 | ``` | |
575 | cd livescript | |
576 | make | |
577 | node_modules/.bin/lsc stepX_YYY.ls | |
578 | ``` | |
579 | ||
4eb88ef2 DM |
580 | ### Logo |
581 | ||
582 | *The Logo implementation was created by [Dov Murik](https://github.com/dubek)* | |
583 | ||
584 | The Logo implementation of mal has been tested with UCBLogo 6.0. | |
585 | ||
586 | ``` | |
587 | cd logo | |
588 | logo stepX_YYY.lg | |
589 | ``` | |
590 | ||
9d42904e JM |
591 | ### Lua |
592 | ||
8a9d0a8a | 593 | Running the Lua implementation of mal requires lua 5.1 or later, |
9d42904e JM |
594 | luarocks and the lua-rex-pcre library installed. |
595 | ||
596 | ``` | |
597 | cd lua | |
598 | make # to build and link linenoise.so | |
599 | ./stepX_YYY.lua | |
600 | ``` | |
601 | ||
bcddc3e4 | 602 | ### Mal |
60154d24 JM |
603 | |
604 | Running the mal implementation of mal involves running stepA of one of | |
605 | the other implementations and passing the mal step to run as a command | |
5d446bd8 | 606 | line argument. |
60154d24 JM |
607 | |
608 | ``` | |
609 | cd IMPL | |
610 | IMPL_STEPA_CMD ../mal/stepX_YYY.mal | |
611 | ||
612 | ``` | |
613 | ||
bcddc3e4 | 614 | ### GNU Make 3.81 |
60154d24 JM |
615 | |
616 | ``` | |
617 | cd make | |
618 | make -f stepX_YYY.mk | |
619 | ``` | |
620 | ||
331ddfed BD |
621 | ### NASM |
622 | ||
623 | *The NASM implementation was created by [Ben Dudson](https://github.com/bendudson)* | |
624 | ||
625 | The NASM implementation of mal is written for x86-64 Linux, and has been tested | |
626 | with Linux 3.16.0-4-amd64 and NASM version 2.11.05. | |
627 | ||
628 | ``` | |
629 | cd nasm | |
630 | make | |
631 | ./stepX_YYY | |
632 | ``` | |
633 | ||
4603f2a9 | 634 | ### Nim 0.17.0 |
a2cd0a3a | 635 | |
a848d783 JM |
636 | *The Nim implementation was created by [Dennis Felsing (def-)](https://github.com/def-)* |
637 | ||
4603f2a9 | 638 | The Nim implementation of mal has been tested with Nim 0.17.0. |
a2cd0a3a | 639 | |
640 | ``` | |
641 | cd nim | |
642 | make | |
643 | # OR | |
644 | nimble build | |
645 | ./stepX_YYY | |
646 | ``` | |
647 | ||
0067158f JM |
648 | ### Object Pascal |
649 | ||
650 | The Object Pascal implementation of mal has been built and tested on | |
651 | Linux using the Free Pascal compiler version 2.6.2 and 2.6.4. | |
652 | ||
653 | ``` | |
654 | cd objpascal | |
655 | make | |
656 | ./stepX_YYY | |
657 | ``` | |
658 | ||
7cae6e6f JM |
659 | ### Objective C |
660 | ||
661 | The Objective C implementation of mal has been built and tested on | |
2faae94c JM |
662 | Linux using clang/LLVM 3.6. It has also been built and tested on OS |
663 | X using XCode 7. | |
7cae6e6f JM |
664 | |
665 | ``` | |
666 | cd objc | |
667 | make | |
668 | ./stepX_YYY | |
669 | ``` | |
670 | ||
bc6448bc C |
671 | ### OCaml 4.01.0 |
672 | ||
a848d783 JM |
673 | *The OCaml implementation was created by [Chris Houser (chouser)](https://github.com/chouser)* |
674 | ||
bc6448bc C |
675 | ``` |
676 | cd ocaml | |
677 | make | |
678 | ./stepX_YYY | |
679 | ``` | |
680 | ||
4bb2ab37 | 681 | ### MatLab (GNU Octave and MATLAB) |
8a9d0a8a | 682 | |
4bb2ab37 JM |
683 | The MatLab implementation has been tested with GNU Octave 4.2.1. |
684 | It has also been tested with MATLAB version R2014a on Linux. Note that | |
685 | MATLAB is a commercial product. | |
8a9d0a8a JM |
686 | |
687 | ``` | |
688 | cd matlab | |
689 | ./stepX_YYY | |
4bb2ab37 | 690 | octave -q --no-gui --no-history --eval "stepX_YYY();quit;" |
8a9d0a8a JM |
691 | matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY();quit;" |
692 | # OR with command line arguments | |
4bb2ab37 | 693 | octave -q --no-gui --no-history --eval "stepX_YYY('arg1','arg2');quit;" |
8a9d0a8a JM |
694 | matlab -nodisplay -nosplash -nodesktop -nojvm -r "stepX_YYY('arg1','arg2');quit;" |
695 | ``` | |
696 | ||
1218ce98 JM |
697 | ### miniMAL |
698 | ||
699 | [miniMAL](https://github.com/kanaka/miniMAL) is small Lisp interpreter | |
700 | implemented in less than 1024 bytes of JavaScript. To run the miniMAL | |
701 | implementation of mal you need to download/install the miniMAL | |
702 | interpreter (which requires Node.js). | |
703 | ``` | |
1218ce98 | 704 | cd miniMAL |
478fd9ce JM |
705 | # Download miniMAL and dependencies |
706 | npm install | |
707 | export PATH=`pwd`/node_modules/minimal-lisp/:$PATH | |
708 | # Now run mal implementation in miniMAL | |
1218ce98 JM |
709 | miniMAL ./stepX_YYY |
710 | ``` | |
711 | ||
9b1563a3 | 712 | ### Perl 5.8 |
9e5b2151 JM |
713 | |
714 | For readline line editing support, install Term::ReadLine::Perl or | |
715 | Term::ReadLine::Gnu from CPAN. | |
716 | ||
717 | ``` | |
718 | cd perl | |
719 | perl stepX_YYY.pl | |
720 | ``` | |
721 | ||
a7081401 HÖS |
722 | ### Perl 6 |
723 | ||
724 | *The Perl 6 implementation was created by [Hinrik Örn Sigurðsson](https://github.com/hinrik)* | |
725 | ||
726 | The Perl 6 implementation was tested on Rakudo Perl 6 2016.04. | |
727 | ||
728 | ``` | |
729 | cd perl6 | |
730 | perl6 stepX_YYY.pl | |
731 | ``` | |
9e5b2151 | 732 | |
bcddc3e4 | 733 | ### PHP 5.3 |
60154d24 | 734 | |
01c97316 JM |
735 | The PHP implementation of mal requires the php command line interface |
736 | to run. | |
737 | ||
60154d24 JM |
738 | ``` |
739 | cd php | |
740 | php stepX_YYY.php | |
741 | ``` | |
742 | ||
b6263859 VS |
743 | ### Picolisp |
744 | ||
745 | *The Picolisp implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)* | |
746 | ||
747 | The Picolisp implementation requires libreadline and Picolisp 3.1.11 | |
748 | or later. | |
749 | ||
750 | ``` | |
751 | cd pil | |
752 | ./run | |
753 | ``` | |
754 | ||
b25bf8d8 JM |
755 | ### PL/pgSQL (Postgres SQL Procedural Language) |
756 | ||
b88bb764 JM |
757 | The PL/pgSQL implementation of mal requires a running Postgres server |
758 | (the "kanaka/mal-test-plpgsql" docker image automatically starts | |
759 | a Postgres server). The implementation connects to the Postgres server | |
760 | and create a database named "mal" to store tables and stored | |
761 | procedures. The wrapper script uses the psql command to connect to the | |
762 | server and defaults to the user "postgres" but this can be overridden | |
763 | with the PSQL_USER environment variable. A password can be specified | |
764 | using the PGPASSWORD environment variable. The implementation has been | |
765 | tested with Postgres 9.4. | |
b25bf8d8 JM |
766 | |
767 | ``` | |
768 | cd plpgsql | |
769 | ./wrap.sh stepX_YYY.sql | |
b88bb764 JM |
770 | # OR |
771 | PSQL_USER=myuser PGPASSWORD=mypass ./wrap.sh stepX_YYY.sql | |
772 | ``` | |
773 | ||
774 | ### PL/SQL (Oracle SQL Procedural Language) | |
775 | ||
776 | The PL/pgSQL implementation of mal requires a running Oracle DB | |
777 | server (the "kanaka/mal-test-plsql" docker image automatically | |
778 | starts an Oracle Express server). The implementation connects to the | |
779 | Oracle server to create types, tables and stored procedures. The | |
780 | default SQL*Plus logon value (username/password@connect_identifier) is | |
781 | "system/oracle" but this can be overridden with the ORACLE_LOGON | |
782 | environment variable. The implementation has been tested with Oracle | |
783 | Express Edition 11g Release 2. Note that any SQL*Plus connection | |
784 | warnings (user password expiration, etc) will interfere with the | |
785 | ability of the wrapper script to communicate with the DB. | |
786 | ||
787 | ``` | |
788 | cd plsql | |
789 | ./wrap.sh stepX_YYY.sql | |
790 | # OR | |
791 | ORACLE_LOGON=myuser/mypass@ORCL ./wrap.sh stepX_YYY.sql | |
b25bf8d8 JM |
792 | ``` |
793 | ||
5c34565f JM |
794 | ### Postscript Level 2/3 |
795 | ||
796 | The Postscript implementation of mal requires ghostscript to run. It | |
797 | has been tested with ghostscript 9.10. | |
798 | ||
799 | ``` | |
800 | cd ps | |
801 | gs -q -dNODISPLAY -I./ stepX_YYY.ps | |
802 | ``` | |
803 | ||
804 | ### PowerShell | |
805 | ||
806 | The PowerShell implementation of mal requires the PowerShell script | |
807 | language. It has been tested with PowerShell 6.0.0 Alpha 9 on Linux. | |
808 | ||
809 | ``` | |
810 | cd powershell | |
811 | powershell ./stepX_YYY.ps1 | |
812 | ``` | |
813 | ||
2d76e877 | 814 | ### Python (2.X and 3.X) |
60154d24 JM |
815 | |
816 | ``` | |
817 | cd python | |
818 | python stepX_YYY.py | |
819 | ``` | |
8adb0827 | 820 | |
23e38cd2 JM |
821 | ### RPython |
822 | ||
823 | You must have [rpython](https://rpython.readthedocs.org/) on your path | |
824 | (included with [pypy](https://bitbucket.org/pypy/pypy/)). | |
825 | ||
826 | ``` | |
827 | cd rpython | |
4e8d7c28 | 828 | make # this takes a very long time |
23e38cd2 JM |
829 | ./stepX_YYY |
830 | ``` | |
831 | ||
9b3362e8 JM |
832 | ### R |
833 | ||
834 | The R implementation of mal requires R (r-base-core) to run. | |
835 | ||
836 | ``` | |
837 | cd r | |
9d42904e | 838 | make libs # to download and build rdyncall |
f5223195 JM |
839 | Rscript stepX_YYY.r |
840 | ``` | |
841 | ||
842 | ### Racket (5.3) | |
843 | ||
844 | The Racket implementation of mal requires the Racket | |
845 | compiler/interpreter to run. | |
846 | ||
847 | ``` | |
848 | cd racket | |
3796240a | 849 | ./stepX_YYY.rkt |
9b3362e8 JM |
850 | ``` |
851 | ||
44a3e2ef DM |
852 | ### Rexx |
853 | ||
854 | *The Rexx implementation was created by [Dov Murik](https://github.com/dubek)* | |
855 | ||
856 | The Rexx implementation of mal has been tested with Regina Rexx 3.6. | |
857 | ||
858 | ``` | |
859 | cd rexx | |
860 | make | |
861 | rexx -a ./stepX_YYY.rexxpp | |
862 | ``` | |
863 | ||
107d9694 | 864 | ### Ruby (1.9+) |
8adb0827 JM |
865 | |
866 | ``` | |
867 | cd ruby | |
868 | ruby stepX_YYY.rb | |
869 | ``` | |
592eb5cf | 870 | |
9106a221 | 871 | ### Rust (1.0.0 nightly) |
abdd56eb JM |
872 | |
873 | The rust implementation of mal requires the rust compiler and build | |
874 | tool (cargo) to build. | |
875 | ||
876 | ``` | |
877 | cd rust | |
bbeb1b87 | 878 | cargo run --release --bin stepX_YYY |
abdd56eb JM |
879 | ``` |
880 | ||
821930db JM |
881 | ### Scala ### |
882 | ||
883 | Install scala and sbt (http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html): | |
884 | ||
885 | ``` | |
886 | cd scala | |
887 | sbt 'run-main stepX_YYY' | |
888 | # OR | |
889 | sbt compile | |
890 | scala -classpath target/scala*/classes stepX_YYY | |
891 | ``` | |
892 | ||
6c0968a6 | 893 | ### Scheme (R7RS) ### |
ff3a8bf8 VS |
894 | |
895 | *The Scheme implementation was created by [Vasilij Schneidermann](https://github.com/wasamasa)* | |
896 | ||
897 | The Scheme implementation of mal has been tested with Chibi-Scheme | |
898 | 0.7.3, Kawa 2.4, Gauche 0.9.5, CHICKEN 4.11.0, Sagittarius 0.8.3, | |
899 | Cyclone 0.6.3 (Git version) and Foment 0.4 (Git version). You should | |
900 | be able to get it running on other conforming R7RS implementations | |
901 | after figuring out how libraries are loaded and adjusting the | |
902 | `Makefile` and `run` script accordingly. | |
903 | ||
904 | ``` | |
a7b8df67 | 905 | cd scheme |
ff3a8bf8 VS |
906 | make symlinks |
907 | # chibi | |
6c0968a6 | 908 | scheme_MODE=chibi ./run |
ff3a8bf8 VS |
909 | # kawa |
910 | make kawa | |
6c0968a6 | 911 | scheme_MODE=kawa ./run |
ff3a8bf8 | 912 | # gauche |
6c0968a6 | 913 | scheme_MODE=gauche ./run |
ff3a8bf8 VS |
914 | # chicken |
915 | make chicken | |
6c0968a6 | 916 | scheme_MODE=chicken ./run |
ff3a8bf8 | 917 | # sagittarius |
6c0968a6 | 918 | scheme_MODE=sagittarius ./run |
ff3a8bf8 VS |
919 | # cyclone |
920 | make cyclone | |
6c0968a6 | 921 | scheme_MODE=cyclone ./run |
ff3a8bf8 | 922 | # foment |
6c0968a6 | 923 | scheme_MODE=foment ./run |
ff3a8bf8 VS |
924 | ``` |
925 | ||
034e82ad DM |
926 | ### Skew ### |
927 | ||
928 | *The Skew implementation was created by [Dov Murik](https://github.com/dubek)* | |
929 | ||
930 | The Skew implementation of mal has been tested with Skew 0.7.42. | |
931 | ||
932 | ``` | |
933 | cd skew | |
934 | make | |
935 | node stepX_YYY.js | |
936 | ``` | |
937 | ||
938 | ||
2539e6af KR |
939 | ### Swift |
940 | ||
a848d783 JM |
941 | *The Swift implementation was created by [Keith Rollin](https://github.com/keith-rollin)* |
942 | ||
e31349f6 KR |
943 | The Swift implementation of mal requires the Swift 2.0 compiler (XCode |
944 | 7.0) to build. Older versions will not work due to changes in the | |
945 | language and standard library. | |
8b142f08 | 946 | |
2539e6af KR |
947 | ``` |
948 | cd swift | |
949 | make | |
950 | ./stepX_YYY | |
951 | ``` | |
952 | ||
ea1395aa JM |
953 | ### Swift 3 |
954 | ||
955 | The Swift 3 implementation of mal requires the Swift 3.0 compiler. It | |
a3a6f680 | 956 | has been tested with Swift 3 Preview 3. |
ea1395aa JM |
957 | |
958 | ``` | |
959 | cd swift3 | |
960 | make | |
961 | ./stepX_YYY | |
962 | ``` | |
963 | ||
54d9903c DM |
964 | ### Tcl 8.6 |
965 | ||
966 | *The Tcl implementation was created by [Dov Murik](https://github.com/dubek)* | |
967 | ||
968 | The Tcl implementation of mal requires Tcl 8.6 to run. For readline line | |
969 | editing support, install tclreadline. | |
970 | ||
971 | ``` | |
972 | cd tcl | |
973 | tclsh ./stepX_YYY.tcl | |
974 | ``` | |
975 | ||
c527d565 | 976 | ### TypeScript |
977 | ||
db885df9 | 978 | *The TypeScript implementation was created by [vvakame](https://github.com/vvakame)* |
979 | ||
c527d565 | 980 | The TypeScript implementation of mal requires the TypeScript 2.2 compiler. |
db885df9 | 981 | It has been tested with Node.js v6. |
c527d565 | 982 | |
983 | ``` | |
984 | cd ts | |
985 | make | |
986 | node ./stepX_YYY.js | |
987 | ``` | |
988 | ||
36e91db4 DM |
989 | ### VHDL |
990 | ||
991 | *The VHDL implementation was created by [Dov Murik](https://github.com/dubek)* | |
992 | ||
993 | The VHDL implementation of mal has been tested with GHDL 0.29. | |
994 | ||
995 | ``` | |
996 | cd vhdl | |
997 | make | |
998 | ./run_vhdl.sh ./stepX_YYY | |
999 | ``` | |
1000 | ||
50a964ce DM |
1001 | ### Vimscript |
1002 | ||
1003 | *The Vimscript implementation was created by [Dov Murik](https://github.com/dubek)* | |
1004 | ||
aa62cbda | 1005 | The Vimscript implementation of mal requires Vim 8.0 to run. |
50a964ce DM |
1006 | |
1007 | ``` | |
1008 | cd vimscript | |
1009 | ./run_vimscript.sh ./stepX_YYY.vim | |
1010 | ``` | |
1011 | ||
ee7cd585 JM |
1012 | ### Visual Basic.NET ### |
1013 | ||
1014 | The VB.NET implementation of mal has been tested on Linux using the Mono | |
1015 | VB compiler (vbnc) and the Mono runtime (version 2.10.8.1). Both are | |
1016 | required to build and run the VB.NET implementation. | |
1017 | ||
1018 | ``` | |
1019 | cd vb | |
1020 | make | |
1021 | mono ./stepX_YYY.exe | |
1022 | ``` | |
1023 | ||
a3665311 DM |
1024 | ### Yorick |
1025 | ||
1026 | *The Yorick implementation was created by [Dov Murik](https://github.com/dubek)* | |
1027 | ||
1028 | The Yorick implementation of mal was tested on Yorick 2.2.04. | |
1029 | ||
1030 | ``` | |
1031 | cd yorick | |
1032 | yorick -batch ./stepX_YYY.i | |
1033 | ``` | |
1034 | ||
ee7cd585 JM |
1035 | |
1036 | ||
592eb5cf JM |
1037 | ## Running tests |
1038 | ||
294aba2c JM |
1039 | ### Functional tests |
1040 | ||
eaa6ceb4 | 1041 | The are over 600 generic functional tests (for all implementations) |
294aba2c JM |
1042 | in the `tests/` directory. Each step has a corresponding test file |
1043 | containing tests specific to that step. The `runtest.py` test harness | |
bd62ff74 JM |
1044 | launches a Mal step implementation and then feeds the tests one at |
1045 | a time to the implementation and compares the output/return value to | |
1046 | the expected output/return value. | |
592eb5cf JM |
1047 | |
1048 | To simplify the process of running tests, a top level Makefile is | |
1049 | provided with convenient test targets. | |
1050 | ||
1051 | * To run all the tests across all implementations (be prepared to wait): | |
1052 | ||
1053 | ``` | |
1054 | make test | |
1055 | ``` | |
1056 | ||
1057 | * To run all tests against a single implementation: | |
1058 | ||
1059 | ``` | |
e5737b08 | 1060 | make "test^IMPL" |
592eb5cf JM |
1061 | |
1062 | # e.g. | |
e5737b08 SL |
1063 | make "test^clojure" |
1064 | make "test^js" | |
592eb5cf JM |
1065 | ``` |
1066 | ||
1067 | * To run tests for a single step against all implementations: | |
1068 | ||
1069 | ``` | |
e5737b08 | 1070 | make "test^stepX" |
592eb5cf JM |
1071 | |
1072 | # e.g. | |
e5737b08 SL |
1073 | make "test^step2" |
1074 | make "test^step7" | |
592eb5cf JM |
1075 | ``` |
1076 | ||
4c58cd4e | 1077 | * To run tests for a specific step against a single implementation: |
592eb5cf JM |
1078 | |
1079 | ``` | |
e5737b08 | 1080 | make "test^IMPL^stepX" |
592eb5cf JM |
1081 | |
1082 | # e.g | |
e5737b08 SL |
1083 | make "test^ruby^step3" |
1084 | make "test^ps^step4" | |
592eb5cf | 1085 | ``` |
fd888612 | 1086 | |
294aba2c JM |
1087 | ### Self-hosted functional tests |
1088 | ||
1089 | * To run the functional tests in self-hosted mode, you specify `mal` | |
1090 | as the test implementation and use the `MAL_IMPL` make variable | |
1091 | to change the underlying host language (default is JavaScript): | |
1092 | ``` | |
e5737b08 | 1093 | make MAL_IMPL=IMPL "test^mal^step2" |
294aba2c JM |
1094 | |
1095 | # e.g. | |
e5737b08 SL |
1096 | make "test^mal^step2" # js is default |
1097 | make MAL_IMPL=ruby "test^mal^step2" | |
1098 | make MAL_IMPL=python "test^mal^step2" | |
294aba2c JM |
1099 | ``` |
1100 | ||
854cf2a6 DM |
1101 | ### Starting the REPL |
1102 | ||
1103 | * To start the REPL of an implementation in a specific step: | |
1104 | ||
1105 | ``` | |
1106 | make "repl^IMPL^stepX" | |
1107 | ||
1108 | # e.g | |
1109 | make "repl^ruby^step3" | |
1110 | make "repl^ps^step4" | |
1111 | ``` | |
1112 | ||
1113 | * If you omit the step, then `stepA` is used: | |
1114 | ||
1115 | ``` | |
1116 | make "repl^IMPL" | |
1117 | ||
1118 | # e.g | |
1119 | make "repl^ruby" | |
1120 | make "repl^ps" | |
1121 | ``` | |
1122 | ||
1123 | * To start the REPL of the self-hosted implementation, specify `mal` as the | |
1124 | REPL implementation and use the `MAL_IMPL` make variable to change the | |
1125 | underlying host language (default is JavaScript): | |
1126 | ``` | |
1127 | make MAL_IMPL=IMPL "repl^mal^stepX" | |
1128 | ||
1129 | # e.g. | |
1130 | make "repl^mal^step2" # js is default | |
1131 | make MAL_IMPL=ruby "repl^mal^step2" | |
1132 | make MAL_IMPL=python "repl^mal" | |
1133 | ``` | |
294aba2c JM |
1134 | |
1135 | ### Performance tests | |
1136 | ||
8569b2af JM |
1137 | Warning: These performance tests are neither statistically valid nor |
1138 | comprehensive; runtime performance is a not a primary goal of mal. If | |
1139 | you draw any serious conclusions from these performance tests, then | |
1140 | please contact me about some amazing oceanfront property in Kansas | |
1141 | that I'm willing to sell you for cheap. | |
1142 | ||
294aba2c JM |
1143 | * To run performance tests against a single implementation: |
1144 | ``` | |
e5737b08 | 1145 | make "perf^IMPL" |
294aba2c JM |
1146 | |
1147 | # e.g. | |
e5737b08 | 1148 | make "perf^js" |
294aba2c JM |
1149 | ``` |
1150 | ||
1151 | * To run performance tests against all implementations: | |
1152 | ``` | |
e5737b08 | 1153 | make "perf" |
294aba2c JM |
1154 | ``` |
1155 | ||
1156 | ### Generating language statistics | |
1157 | ||
4c58cd4e | 1158 | * To report line and byte statistics for a single implementation: |
294aba2c | 1159 | ``` |
e5737b08 | 1160 | make "stats^IMPL" |
294aba2c JM |
1161 | |
1162 | # e.g. | |
e5737b08 | 1163 | make "stats^js" |
294aba2c JM |
1164 | ``` |
1165 | ||
4c58cd4e | 1166 | * To report line and bytes statistics for general Lisp code (env, core |
294aba2c JM |
1167 | and stepA): |
1168 | ``` | |
e5737b08 | 1169 | make "stats-lisp^IMPL" |
294aba2c JM |
1170 | |
1171 | # e.g. | |
e5737b08 | 1172 | make "stats-lisp^js" |
294aba2c JM |
1173 | ``` |
1174 | ||
5b207de7 | 1175 | ## Dockerized testing |
75363567 | 1176 | |
5b207de7 JM |
1177 | Every implementation directory contains a Dockerfile to create |
1178 | a docker image containing all the dependencies for that | |
1179 | implementation. In addition, the top-level Makefile contains support | |
1180 | for running the tests target (and perf, stats, repl, etc) within | |
1181 | a docker container for that implementation by passing *"DOCKERIZE=1"* | |
1182 | on the make command line. For example: | |
75363567 | 1183 | |
75363567 | 1184 | ``` |
5b207de7 | 1185 | make DOCKERIZE=1 "test^js^step3" |
75363567 JM |
1186 | ``` |
1187 | ||
5b207de7 JM |
1188 | Existing implementations already have docker images built and pushed |
1189 | to the docker registry. However, if | |
1190 | you wish to build or rebuild a docker image locally, the toplevel | |
1191 | Makefile provides a rule for building docker images: | |
1192 | ||
75363567 | 1193 | ``` |
5b207de7 JM |
1194 | make "docker-build^IMPL" |
1195 | ``` | |
1196 | ||
75363567 JM |
1197 | |
1198 | **Notes**: | |
5b207de7 JM |
1199 | * Docker images are named *"kanaka/mal-test-IMPL"* |
1200 | * JVM-based language implementations (Groovy, Java, Clojure, Scala): | |
1201 | you will probably need to run these implementations once manually | |
1202 | first (make DOCKERIZE=1 "repl^IMPL")before you can run tests because | |
1203 | runtime dependencies need to be downloaded to avoid the tests timing | |
1204 | out. These dependencies are download to dot-files in the /mal | |
1205 | directory so they will persist between runs. | |
75363567 | 1206 | |
294aba2c | 1207 | |
fd888612 JM |
1208 | ## License |
1209 | ||
1210 | Mal (make-a-lisp) is licensed under the MPL 2.0 (Mozilla Public | |
1211 | License 2.0). See LICENSE.txt for more details. |