Skip to content

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

Notifications You must be signed in to change notification settings

Hosshii/tiger-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages