A Lustre transpiler to Rust.
To transpile a simple example:
cargo run <test/simple.mls >test/simple.rs
To transpile, compile and run a simple example:
cd test
make simple
./simple
When transpiling a Lustre file, Rustre applies these steps:
- Parsing (see
parser.rs
andlustre.pest
): build an raw AST (seeast.rs
) from an input Lustre file - Normalization (see
normalizer.rs
): build a normalized AST (seenast.rs
) from a raw AST - Static scheduling (see
sequentializer.rs
): re-order equations in nodes so that they can be executed sequentially - Code generation (see
rustfmt.rs
): write Rust code from the AST, generate the necessary structures and logic for thefby
operator
Each file contains a head comment which explains in detail what it does.
MIT