Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 1.74 KB

README.md

File metadata and controls

73 lines (54 loc) · 1.74 KB

Joe: MinCaml compiler and virtual machine

Features

  • 4K LOC
  • Intel/ARM 64-bit native compiler (joe)
  • Byte-code IR compiler (joe)
  • Byte-code IR virtual machine (vm)
  • Original MinCaml codebase

Setup

$ opam install ppx_deriving ppx_inline_test
$ dune build

Samples

Compile sample for MinCaml bytecode:

$ _build/install/default/bin/vm -compile examples/fact.ml

Run sample from MinCaml bytecode in VM interpreter:

$ _build/install/default/bin/vm -exec examples/fact.joe
10
3628800

Compile sample for Apple M1 (from MinCaml to Assembler):

$ _build/install/default/bin/joe -arm examples/ack.ml
Generating assembly...OK

Compile assembler and link for macOS:

$ gcc examples/ack.arm.s src/arm64/libmincaml.c src/arm64/stub.c -o ack

Run sample natively on M1:

$ ./ack
509

Resources

Credits

  • Namdak Tonpa