Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 702 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 702 Bytes

interpreter

A simple Koopa IR interpreter (just for example).

Usage

Run in the repository root:

cargo run --example interpreter -- examples/interpreter/ir/42.koopa; echo $?

You will see:

    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/interpreter ir/42.koopa`
42

Or you can run Koopa IR programs with libc loaded:

# for macOS
cargo run --example interpreter -- \
    examples/interpreter/ir/hello.koopa -l /usr/lib/libSystem.B.dylib

You will see:

    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/interpreter ir/hello.koopa -l /usr/lib/libSystem.B.dylib`
Hello, world!