The SimplicityHL language feels very similar to Rust. This crate provides tools to work with SimplicityHL as literal Rust.
We define a Rust type for each SimplicityHL type. We define a Rust function for each SimplicityHL jet. rustdoc
can be used to generate SimplicityHL documentation.
SimplicityHL code is almost Rust code. For the most part, SimplicityHL lacks advanced features such as generics, so the corresponding syntax is missing.
Because there are only few and predictable differences, we can convert SimplicityHL code to Rust code with a simple static algorithm. This tool hasn't been written yet, but it would enable us to compile SimplicityHL code with the Rust compiler.
This means there would be two paths for a SimplicityHL program:
- SimplicityHL → Simplicity → Bit Machine
- SimplicityHL → Rust → any CPU
Using this library as prelude, the SimplicityHL program in (1) that runs on the Bit Machine should behave exactly as the SimplicityHL program in (2) that runs on any CPU.