Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 1.12 KB

README.md

File metadata and controls

65 lines (42 loc) · 1.12 KB

Rust implementation of the first part of "Modern Compiler Implementation in ML"

Build

Requirements

  • Rust
    • wasm32-unknown-unknown target
  • cargo-make
  • node

Build compiler.

cargo build --release

or

cargo make build-release

Build tiger source code.

  1. Compile tiger source code.
./target/release/tiger /path/to/tiger-src > tiger.s

You can specify target by adding --arch <target> argument.

ex. ./target/release/tiger --arch x86_64-apple-darwin main.tig

  1. Link it with runtime.

Linux

clang -no-pie tiger.s ./target/release/libcdylib.so

MacOS

clang -no-pie tiger.s ./target/release/libcdylib.dylib

Wasm

See (compiler-lib/Makefile.toml, index.html, test.js) or (web/Makefile.toml, runWasm.ts).

Supported platform.

  • aarch64-apple-darwin
  • x86_64-apple-darwin
  • x86_64-unknown-linux-gnu
  • wasm32-unknown-unknown

Run test.

cargo make test