https://github.com/groupoid/joe
🧊 Компілятор ML і віртуальна машина
https://github.com/groupoid/joe
Last synced: 6 months ago
JSON representation
🧊 Компілятор ML і віртуальна машина
- Host: GitHub
- URL: https://github.com/groupoid/joe
- Owner: groupoid
- License: other
- Created: 2024-03-30T23:11:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T21:33:31.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T20:27:08.586Z (almost 2 years ago)
- Language: OCaml
- Homepage: https://joe.groupoid.space
- Size: 162 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:
```sh
$ _build/install/default/bin/vm -compile examples/fact.ml
```
Run sample from MinCaml bytecode in VM interpreter:
```sh
$ _build/install/default/bin/vm -exec examples/fact.joe
10
3628800
```
Compile sample for Apple M1 (from MinCaml to Assembler):
```sh
$ _build/install/default/bin/joe -arm examples/ack.ml
Generating assembly...OK
```
Compile assembler and link for macOS:
```sh
$ gcc examples/ack.arm.s src/arm64/libmincaml.c src/arm64/stub.c -o ack
```
Run sample natively on M1:
```sh
$ ./ack
509
```
Resources
---------
* Kenji Nozawa. SICP in Standard ML.
* Eijiro Sumii. A Crash Course for the MinCaml compiler.
* Eijiro Sumii. MinCaml: A Simple and Efficient Compiler for a Minimal Functional Language.
* М. Сохацький. Інформатика.
* C. Okasaki. Purely Functional Data Structures.
* R. Harper. Programming in Standard ML.
* Andrew W. Appel. Modern Compiler Implementation in ML.
* Andreas Rossberg. HaMLet: To Be Or Not To Be Standard ML.
Credits
-------
* Namdak Tonpa