Writing Lazy K interpreters in various languages
language | compiler / interpreter version |
---|---|
Common Lisp | sbcl (Steel Bank Common Lisp) 2.11.1 |
C# | Visual Studio 2022, .NET SDK 7.0 for linux |
Go | Go 1.21.3 |
OCaml | OCaml native-compiler (ocamlopt) 4.14.1 |
Python | Python 3.12.0, PyPy 7.3.13 |
Ruby | Ruby 3.2.2 |
Scheme | Gauche 0.9.12 |
TypeScript | deno 1.38.0 |
Run make
at the root directory of this repository, then following files will be generated.
- bin/cslazyk (C#)
- bin/golazyk (Go)
- bin/mllazyk (OCaml)
- commonlisp/lazyk.fasl
$ make test-unit-(language-name)
You need external libraries or support program to run unit tests in some languages.
$ make test-(language-name)
runs tests using test data in test
directory.
$ sbcl --script commonlisp/run-lazyk.lisp
usage: sbcl --script run-lazyk.lisp <command> [arg]
commands:
run FILENAME : run Lazy K program file
make : make lazyk.fasl
test : run tests for lazyk.lisp (requires quicklisp)
- Open
csharp/lazyk-cs/lazyk-cs.sln
- Select "Publish" from the context menu of the "lazyk-cs" project.
Use Makefile in the root directory of this repository.
$ make csharp
makes csharp/publish/cslazyk
and copies it to bin/cslazyk
.
$ bin/cslazyk -h
Usage: lazyk-cs.exe [options] [programfile]
Options:
-t text input mode (read CRLF as LF)
-h show this help
If no program file is specified, the program is read from the standard input.
$ make go
makes go/golazyk
and copies it to bin/golazyk
$ bin/golazyk
Usage: golazyk [-t] srcfile.lazy
Options
-t : read CRLF as LF
$ make ocaml
makes ocaml/mllazyk
and copies it ot bin/mllazyk
$ bin/mllazyk
usage: mllazyk <source.lazy>
$ python3 python/lazyk.py
Usage: python lazyk.py [-t] srcfile
Option
-t : text mode (read crlf as lf)
$ ruby ruby/lazyk.rb
Usage: ruby [-t] lazyk.rb prog.rb
Options
-t : text mode (read crlf as lf)
$ gosh scheme/lazyk.scm
usage: gosh scheme/lazyk.scm src.lazyk
$ deno run --allow-read typescript/lazyk.ts
usage: deno run --allow-read lazyk.ts <source.lazy>