DISABLE FDs (REMOVE ME).
[jackhill/mal.git] / README.md
index 6710ddb..6d1ed38 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,14 +6,16 @@
 
 **1. Mal is a Clojure inspired Lisp interpreter**
 
-**2. Mal is implemented in 75 languages**
+**2. Mal is implemented in 81 languages (84 different implementations and 104 runtime modes)**
 
 | Language | Creator |
 | -------- | ------- |
 | [Ada](#ada) | [Chris Moore](https://github.com/zmower) |
+| [Ada #2](#ada2) | [Nicolas Boulenguez](https://github.com/asarhaddon) |
 | [GNU Awk](#gnu-awk) | [Miutsuru Kariya](https://github.com/kariya-mitsuru) |
 | [Bash 4](#bash-4) | [Joel Martin](https://github.com/kanaka)  |
 | [BASIC](#basic-c64-and-qbasic) (C64 & QBasic) | [Joel Martin](https://github.com/kanaka) |
+| [BBC BASIC V](#bbc-basic-v) | [Ben Harris](https://github.com/bjh21) |
 | [C](#c) | [Joel Martin](https://github.com/kanaka)  |
 | [C++](#c-1) | [Stephen Thirlwall](https://github.com/sdt) |
 | [C#](#c-2) | [Joel Martin](https://github.com/kanaka)  |
@@ -43,6 +45,7 @@
 | [Io](#io) | [Dov Murik](https://github.com/dubek) |
 | [Java](#java-17) | [Joel Martin](https://github.com/kanaka)  |
 | [JavaScript](#javascriptnode) ([Demo](http://kanaka.github.io/mal)) | [Joel Martin](https://github.com/kanaka) |
+| [jq](#jq) | [Ali MohammadPur](https://github.com/alimpfard) |
 | [Julia](#julia) | [Joel Martin](https://github.com/kanaka)  |
 | [Kotlin](#kotlin) | [Javier Fernandez-Ivern](https://github.com/ivern) |
 | [LiveScript](#livescript) | [Jos van Bakel](https://github.com/c0deaddict) |
 | [MATLAB](#matlab-gnu-octave-and-matlab) (GNU Octave & MATLAB) | [Joel Martin](https://github.com/kanaka) |
 | [miniMAL](#minimal) ([Repo](https://github.com/kanaka/miniMAL), [Demo](https://kanaka.github.io/miniMAL/)) | [Joel Martin](https://github.com/kanaka) |
 | [NASM](#nasm) | [Ben Dudson](https://github.com/bendudson) |
-| [Nim](#nim-0170) | [Dennis Felsing](https://github.com/def-) |
+| [Nim](#nim-104) | [Dennis Felsing](https://github.com/def-) |
 | [Object Pascal](#object-pascal) | [Joel Martin](https://github.com/kanaka)  |
 | [Objective C](#objective-c) | [Joel Martin](https://github.com/kanaka)  |
 | [OCaml](#ocaml-4010) | [Chris Houser](https://github.com/chouser) |
-| [Perl](#perl-58) | [Joel Martin](https://github.com/kanaka)  |
+| [Perl](#perl-5) | [Joel Martin](https://github.com/kanaka)  |
 | [Perl 6](#perl-6) | [Hinrik Örn Sigurðsson](https://github.com/hinrik) |
 | [PHP](#php-53) | [Joel Martin](https://github.com/kanaka)  |
 | [Picolisp](#picolisp) | [Vasilij Schneidermann](https://github.com/wasamasa) |
-| [PL/pgSQL](#plpgsql-postgres-sql-procedural-language) (Postgres) | [Joel Martin](https://github.com/kanaka) |
+| [Pike](#pike) | [Dov Murik](https://github.com/dubek) |
+| [PL/pgSQL](#plpgsql-postgresql-sql-procedural-language) (PostgreSQL) | [Joel Martin](https://github.com/kanaka) |
 | [PL/SQL](#plsql-oracle-sql-procedural-language) (Oracle) | [Joel Martin](https://github.com/kanaka) |
 | [PostScript](#postscript-level-23) | [Joel Martin](https://github.com/kanaka)  |
 | [PowerShell](#powershell) | [Joel Martin](https://github.com/kanaka)  |
 | [Python](#python-2x-and-3x) (2.X & 3.X) | [Joel Martin](https://github.com/kanaka) |
+| [Python #2](#python2-3x) (3.X) | [Gavin Lewis](https://github.com/epylar) |
 | [RPython](#rpython) | [Joel Martin](https://github.com/kanaka)  |
 | [R](#r) | [Joel Martin](https://github.com/kanaka)  |
 | [Racket](#racket-53) | [Joel Martin](https://github.com/kanaka)  |
 | [Rexx](#rexx) | [Dov Murik](https://github.com/dubek) |
 | [Ruby](#ruby-19) | [Joel Martin](https://github.com/kanaka)  |
-| [Rust](#rust-100-nightly) | [Joel Martin](https://github.com/kanaka)  |
+| [Rust](#rust-138) | [Joel Martin](https://github.com/kanaka)  |
 | [Scala](#scala) | [Joel Martin](https://github.com/kanaka)  |
 | [Scheme (R7RS)](#scheme-r7rs) | [Vasilij Schneidermann](https://github.com/wasamasa) |
 | [Skew](#skew) | [Dov Murik](https://github.com/dubek) |
 | [Swift 2](#swift) | [Keith Rollin](https://github.com/keith-rollin) |
 | [Swift 3](#swift-3) | [Joel Martin](https://github.com/kanaka)  |
 | [Swift 4](#swift-4) | [陆遥](https://github.com/LispLY)  |
+| [Swift 5](#swift-5) | [Oleg Montak](https://github.com/MontakOleg)  |
 | [Tcl](#tcl-86) | [Dov Murik](https://github.com/dubek) |
 | [TypeScript](#typescript) | [Masahiro Wakame](https://github.com/vvakame) |
+| [Vala](#vala) | [Simon Tatham](https://github.com/sgtatham) |
 | [VHDL](#vhdl) | [Dov Murik](https://github.com/dubek) |
 | [Vimscript](#vimscript) | [Dov Murik](https://github.com/dubek) |
 | [Visual Basic.NET](#visual-basicnet) | [Joel Martin](https://github.com/kanaka)  |
 | [WebAssembly](#webassembly-wasm) (wasm) | [Joel Martin](https://github.com/kanaka) |
+| [Wren](#wren) | [Dov Murik](https://github.com/dubek) |
 | [Yorick](#yorick) | [Dov Murik](https://github.com/dubek) |
+| [Zig](#zig) | [Josh Tobin](https://github.com/rjtobin) |
 
 
 **3. Mal is a learning tool**
@@ -115,7 +124,7 @@ Here is the final diagram for [step A](process/guide.md#stepA):
 
 ![stepA_mal architecture](process/stepA_mal.png)
 
-If you are interesting in creating a mal implementation (or just
+If you are interested in creating a mal implementation (or just
 interested in using mal for something), please drop by the #mal
 channel on freenode. In addition to the [make-a-lisp process
 guide](process/guide.md) there is also a [mal/make-a-lisp
@@ -156,6 +165,29 @@ make DOCKERIZE=1 "repl^IMPL^stepX"
 make DOCKERIZE=1 "repl^IMPL"
 ```
 
+## External Implementations
+
+The following implementations are maintained as separate projects:
+
+### HolyC
+
+* [by Alexander Bagnalla](https://github.com/bagnalla/holyc_mal)
+
+### Rust
+
+* [by Tim Morgan](https://github.com/seven1m/mal-rust)
+* [by vi](https://github.com/vi/mal-rust-vi) - using [Pest](https://pest.rs/) grammar, not using typical Mal infrastructure (cargo-ized steps and built-in converted tests).
+
+
+## Other mal Projects
+
+ * [malc](https://github.com/dubek/malc) - Mal (Make A Lisp) compiler. Compiles a Mal program to LLVM assembly language, then binary.
+ * [malcc](https://github.com/seven1m/malcc) - malcc is an incremental compiler implementation for the Mal language. It uses the Tiny C Compiler as the compiler backend and has full support for the Mal language, including macros, tail-call elimination, and even run-time eval. ["I Built a Lisp Compiler"](https://mpov.timmorgan.org/i-built-a-lisp-compiler/) post about the process.
+ * [frock](https://github.com/chr15m/frock) - Clojure-flavoured PHP. Uses mal/php to run programs.
+ * [flk](https://github.com/chr15m/flk) - A LISP that runs wherever Bash is
+
+
+## Implementation Details
 
 ### Ada
 
@@ -170,6 +202,17 @@ make
 ./stepX_YYY
 ```
 
+### Ada.2
+
+The second Ada implementation was developed with GNAT 8 and links with
+the GNU readline library.
+
+```
+cd ada
+make
+./stepX_YYY
+```
+
 ### GNU awk
 
 The GNU awk implementation of mal has been tested with GNU awk 4.1.1.
@@ -214,6 +257,22 @@ make MODE=qbasic stepX_YYY.bas
 Thanks to [Steven Syrek](https://github.com/sjsyrek) for the original
 inspiration for this implementation.
 
+### BBC BASIC V
+
+The BBC BASIC V implementation can run in the Brandy interpreter:
+
+```
+cd bbc-basic
+brandy -quit stepX_YYY.bbc
+```
+
+Or in ARM BBC BASIC V under RISC OS 3 or later:
+
+```
+*Dir bbc-basic.riscos
+*Run setup
+*Run stepX_YYY
+```
 
 ### C
 
@@ -533,7 +592,7 @@ mvn -quiet exec:java -Dexec.mainClass=mal.stepX_YYY -Dexec.args="CMDLINE_ARGS"
 
 ```
 cd js
-npm update
+npm install
 node stepX_YYY.js
 ```
 
@@ -546,6 +605,17 @@ cd julia
 julia stepX_YYY.jl
 ```
 
+### jq
+
+Tested against version 1.6, with a lot of cheating in the IO department
+
+```
+cd jq
+STEP=stepA_YYY ./run
+    # with Debug
+DEBUG=true STEP=stepA_YYY ./run
+```
+
 ### Kotlin
 
 The Kotlin implementation of mal has been tested with Kotlin 1.0.
@@ -617,9 +687,9 @@ make
 ./stepX_YYY
 ```
 
-### Nim 0.17.0
+### Nim 1.0.4
 
-The Nim implementation of mal has been tested with Nim 0.17.0.
+The Nim implementation of mal has been tested with Nim 1.0.4.
 
 ```
 cd nim
@@ -691,7 +761,9 @@ export PATH=`pwd`/node_modules/minimal-lisp/:$PATH
 miniMAL ./stepX_YYY
 ```
 
-### Perl 5.8
+### Perl 5
+
+The Perl 5 implementation should work with perl 5.19.3 and later.
 
 For readline line editing support, install Term::ReadLine::Perl or
 Term::ReadLine::Gnu from CPAN.
@@ -730,17 +802,26 @@ cd picolisp
 ./run
 ```
 
-### PL/pgSQL (Postgres SQL Procedural Language)
+### Pike
+
+The Pike implementation was tested on Pike 8.0.
+
+```
+cd pike
+pike stepX_YYY.pike
+```
+
+### PL/pgSQL (PostgreSQL SQL Procedural Language)
 
-The PL/pgSQL implementation of mal requires a running Postgres server
+The PL/pgSQL implementation of mal requires a running PostgreSQL server
 (the "kanaka/mal-test-plpgsql" docker image automatically starts
-a Postgres server). The implementation connects to the Postgres server
+a PostgreSQL server). The implementation connects to the PostgreSQL server
 and create a database named "mal" to store tables and stored
 procedures. The wrapper script uses the psql command to connect to the
 server and defaults to the user "postgres" but this can be overridden
 with the PSQL_USER environment variable. A password can be specified
 using the PGPASSWORD environment variable. The implementation has been
-tested with Postgres 9.4.
+tested with PostgreSQL 9.4.
 
 ```
 cd plpgsql
@@ -751,14 +832,14 @@ PSQL_USER=myuser PGPASSWORD=mypass ./wrap.sh stepX_YYY.sql
 
 ### PL/SQL (Oracle SQL Procedural Language)
 
-The PL/pgSQL implementation of mal requires a running Oracle DB
+The PL/SQL implementation of mal requires a running Oracle DB
 server (the "kanaka/mal-test-plsql" docker image automatically
 starts an Oracle Express server). The implementation connects to the
 Oracle server to create types, tables and stored procedures. The
-default SQL*Plus logon value (username/password@connect_identifier) is
+default SQL\*Plus logon value (username/password@connect_identifier) is
 "system/oracle" but this can be overridden with the ORACLE_LOGON
 environment variable. The implementation has been tested with Oracle
-Express Edition 11g Release 2. Note that any SQL*Plus connection
+Express Edition 11g Release 2. Note that any SQL\*Plus connection
 warnings (user password expiration, etc) will interfere with the
 ability of the wrapper script to communicate with the DB.
 
@@ -769,10 +850,10 @@ cd plsql
 ORACLE_LOGON=myuser/mypass@ORCL ./wrap.sh stepX_YYY.sql
 ```
 
-### Postscript Level 2/3
+### PostScript Level 2/3
 
-The Postscript implementation of mal requires ghostscript to run. It
-has been tested with ghostscript 9.10.
+The PostScript implementation of mal requires Ghostscript to run. It
+has been tested with Ghostscript 9.10.
 
 ```
 cd ps
@@ -796,6 +877,16 @@ cd python
 python stepX_YYY.py
 ```
 
+### Python.2 (3.X)
+
+The second Python implementation makes heavy use of type annotations and uses the Arpeggio parser library.
+
+```
+# Recommended: do these steps in a Python virtual environment.
+pip3 install Arpeggio==1.9.0
+python3 stepX_YYY.py
+```
+
 ### RPython
 
 You must have [rpython](https://rpython.readthedocs.org/) on your path
@@ -844,7 +935,7 @@ cd ruby
 ruby stepX_YYY.rb
 ```
 
-### Rust (1.0.0 nightly)
+### Rust (1.38+)
 
 The rust implementation of mal requires the rust compiler and build
 tool (cargo) to build.
@@ -942,6 +1033,16 @@ make
 ./stepX_YYY
 ```
 
+### Swift 5
+
+The Swift 5 implementation of mal requires the Swift 5.0 compiler. It
+has been tested with Swift 5.1.1 release.
+
+```
+cd swift5
+swift run stepX_YYY
+```
+
 ### Tcl 8.6
 
 The Tcl implementation of mal requires Tcl 8.6 to run.  For readline line
@@ -963,6 +1064,18 @@ make
 node ./stepX_YYY.js
 ```
 
+### Vala
+
+The Vala implementation of mal has been tested with the Vala 0.40.8
+compiler. You will need to install `valac` and `libreadline-dev` or
+equivalent.
+
+```
+cd vala
+make
+./stepX_YYY
+```
+
 ### VHDL
 
 The VHDL implementation of mal has been tested with GHDL 0.29.
@@ -998,13 +1111,47 @@ mono ./stepX_YYY.exe
 
 The WebAssembly implementation is written in
 [Wam](https://github.com/kanaka/wam) (WebAssembly Macro language) and
-runs under the [wac/wace](https://github.com/kanaka/wac) WebAssembly
-runtime.
+runs under several different non-web embeddings (runtimes):
+[node](https://nodejs.org),
+[wasmtime](https://github.com/CraneStation/wasmtime),
+[wasmer](https://wasmer.io),
+[lucet](https://github.com/fastly/lucet),
+[wax](https://github.com/kanaka/wac),
+[wace](https://github.com/kanaka/wac),
+[warpy](https://github.com/kanaka/warpy).
 
 ```
 cd wasm
-make
+# node
+make wasm_MODE=node
+./run.js ./stepX_YYY.wasm
+# wasmtime
+make wasm_MODE=wasmtime
+wasmtime --dir=./ --dir=../ --dir=/ ./stepX_YYY.wasm
+# wasmer
+make wasm_MODE=wasmer
+wasmer run --dir=./ --dir=../ --dir=/ ./stepX_YYY.wasm
+# lucet
+make wasm_MODE=lucet
+lucet-wasi --dir=./:./ --dir=../:../ --dir=/:/ ./stepX_YYY.so
+# wax
+make wasm_MODE=wax
+wax ./stepX_YYY.wasm
+# wace
+make wasm_MODE=wace_libc
 wace ./stepX_YYY.wasm
+# warpy
+make wasm_MODE=warpy
+warpy --argv --memory-pages 256 ./stepX_YYY.wasm
+```
+
+### Wren
+
+The Wren implementation of mal was tested on Wren 0.2.0.
+
+```
+cd wren
+wren ./stepX_YYY.wren
 ```
 
 ### Yorick
@@ -1016,6 +1163,15 @@ cd yorick
 yorick -batch ./stepX_YYY.i
 ```
 
+### Zig
+
+The Zig implementation of mal was tested on Zig 0.5.
+
+```
+cd zig
+zig build stepX_YYY
+```
+
 
 
 ## Running tests
@@ -1030,7 +1186,7 @@ make help
 
 ### Functional tests
 
-The are over 600 generic functional tests (for all implementations)
+The are almost 800 generic functional tests (for all implementations)
 in the `tests/` directory. Each step has a corresponding test file
 containing tests specific to that step. The `runtest.py` test harness
 launches a Mal step implementation and then feeds the tests one at
@@ -1152,15 +1308,6 @@ make "stats^IMPL"
 make "stats^js"
 ```
 
-* To report line and bytes statistics for general Lisp code (env, core
-  and stepA):
-```
-make "stats-lisp^IMPL"
-
-# e.g.
-make "stats-lisp^js"
-```
-
 ## Dockerized testing
 
 Every implementation directory contains a Dockerfile to create
@@ -1194,26 +1341,6 @@ make "docker-build^IMPL"
   directory so they will persist between runs.
 
 
-## External Implementations
-
-The following implementations are maintained as separate projects:
-
-### HolyC
-
-* [by Alexander Bagnalla](https://github.com/bagnalla/holyc_mal)
-
-### Rust
-
-* [by Tim Morgan](https://github.com/seven1m/mal-rust)
-* [by vi](https://github.com/vi/mal-rust-vi) - using [Pest](https://pest.rs/) grammar, not using typical Mal infrastructure (cargo-ized steps and built-in converted tests).
-
-
-## Other mal Projects
-
- * [malc](https://github.com/dubek/malc) - Mal (Make A Lisp) compiler. Compiles a Mal program to LLVM assembly language, then binary.
- * [malcc](https://git.sr.ht/~tim/malcc) (@seven1m) - malcc is an incremental compiler implementation for the Mal language. It uses the Tiny C Compiler as the compiler backend and has full support for the Mal language, including macros, tail-call elimination, and even run-time eval. ["I Built a Lisp Compiler"](https://mpov.timmorgan.org/i-built-a-lisp-compiler/) post about the process.
- * [frock](https://github.com/chr15m/frock) - Clojure-flavoured PHP. Uses mal/php to run programs.
-
 ## License
 
 Mal (make-a-lisp) is licensed under the MPL 2.0 (Mozilla Public