Structured text compiler written in Rust
RuSTy is a structured text (ST) compiler written in Rust. RuSTy utilizes the LLVM framework to compile eventually to native code.
The easiest way to compile this project is to use the provided Dockerfile
. The project offers a .devcontainer
when using VSCode. The Dockerfile offers a linux-image which contains everything you need to run cargo build
/ cargo test
in the project's root directory.
If you want to build the project without docker, start here.
The compiler's documentation can be found here: documentation.
If you want to contribute to the project you should look for some beginner-friendly issues and reach out to project's maintainers.
Structured Text is a popular language in the domain of automation. A standardized specification of the language (IEC 61131) was published in the 90s. It was updated several times in the meantime, while its initial spirit - being built for cyclic, robust and deterministic automation applications - still applies.
Several automation platform suppliers built proprietary compilers and runtime libraries, native to the vendor's hard- and software platform.
RuSTy is aiming towards a fast, modern and open-source industry-grade ST compiler for a wide range of platforms, sticking close to the standard.
We use the logos crate library to perform lexical analysis before a handwritten recursive decent parser creates the AST. Generating LLVM IR is accomplished with the help of inkwell, a Rust-wrapper around the native LLVM C-API.