Source code for the examples in a book.
See the test.sh
files within the individual directories to see how to build
and run the examples, most of which are scripts with internal assertions.
The examples here have been tested on a machine running macOS using the following language implementations and versions:
Language | Version | Notes | |
---|---|---|---|
Ada | 2015 | ||
APL | ngn/apl demo | ||
AWK | 20070501 | ||
Bash | 3.2.57 | (This was the version pre-installed on my MacBook Pro, though newer versions exist) | |
Befunge | |||
Brainfuck | |||
C | C11 | Apple LLVM version 8.1.0 (clang-802.0.42) | |
C# | Mono C# compiler version 4.4.1.0 | ||
C++ | C++14 | Apple LLVM version 8.1.0 (clang-802.0.42) | |
Ceylon | |||
Chapel | 1.19.0 | ||
Clojure | 1.10.0 | ||
CoffeeScript | 1.12.2 | (Run under Node 8.1.3) | |
Crystal | |||
D | DMD64 D Compiler v2.076.0 | ||
Dart | 1.24.2 | ||
Elixir | |||
Elm | 0.18.0 | ||
Erlang | Erlang/OTP 21 | ||
Factor | |||
F# | |||
Fortran | GNU Fortran (GCC) 6.1.0 | ||
Go | 1.12.5 | go version go1.12.5 darwin/amd64 | |
Hack | |||
Haskell | 2010 | The Glorious Glasgow Haskell Compilation System, version 8.0.2 | |
Idris | 1.3.1 | ||
Io | 20140919 | ||
Java | 11.0.1 | ||
JavaScript | ES2016 | Node 12.3.0 | |
Julia | 1.1.1 | ||
K | Kona Win.3.39-69 | Kona is an open source version of K | |
Kotlin | |||
LOLCODE | 0.11.2 | ||
Lua | 5.3.4 | ||
Mercury | |||
Nasm | 2.13.01 | ||
Nemerle | |||
Nim | |||
OCaml | 4.07.1 | ||
Perl | 5.26.0 | ||
Prolog | |||
PureScript | 0.11.5 | ||
Python | 3.6.1 | ||
R | |||
Racket | |||
Ruby | 2.4.1p111 | ||
Rust | 1.18.0 | ||
Scala | 2.12.8 | ||
Smalltalk | |||
Standard ML | mlton-20180207 | ||
Swift | 4.2.1 | Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1) | |
Tcl | |||
Wake | |||
Whiley |