8 releases

0.0.7 Sep 17, 2024
0.0.6 Sep 6, 2024
0.0.4 Aug 31, 2024
0.0.1 Jul 22, 2024
0.0.0 May 23, 2024

#3 in #midenc

Download history 143/week @ 2024-08-23 540/week @ 2024-08-30 158/week @ 2024-09-06 172/week @ 2024-09-13 68/week @ 2024-09-20 38/week @ 2024-09-27 24/week @ 2024-10-04 18/week @ 2024-10-11 15/week @ 2024-10-18 11/week @ 2024-10-25 21/week @ 2024-11-01 5/week @ 2024-11-08 11/week @ 2024-11-15 16/week @ 2024-11-22 30/week @ 2024-11-29 56/week @ 2024-12-06

113 downloads per month
Used in 10 crates (2 directly)

MIT license

72KB
1.5K SLoC

Miden Compiler

[!IMPORTANT] This project is a work-in-progress, so if you encounter bugs or other things which are not covered in the issue tracker, there is a good chance we know about them, but please do report them anyway so we can ensure they are tracked publically as well.

This repository contains the Miden compiler, which can be used both as a compiler backend for existing languages that wish to target Miden Assembly using a standard SSA-based IR; or as means of compiling WebAssembly (Wasm) produced by another compiler to Miden Assembly.

This repo is broken into the following high-level components:

  • Miden HIR (high-level intermediate representation) and it's supporting crates; providing everything needed to build and compile IR for a program you want to emit Miden Assembly for.
  • The Wasm frontend; a library which can be used to convert a program compiled to .wasm to HIR
  • The midenc executable, which provides a command-line tool that provides a convenient way to compile Wasm or HIR modules/programs to Miden Assembly and test them.

[!TIP] We've published initial documentation in mdBook format for easier reading, also accessible in the docs directory. This documentation covers how to get started with the compiler, provides a couple guides for currently supported use cases, and contains appendices that go into detail about various design aspects of the toolchain.

Building

You'll need to have Rust installed (at time of writing, we're doing development against Rust 1.73).

Additionally, you'll want to have cargo-make installed:

$ cargo install cargo-make

From there, you can build all of the tooling used for the compiler, including the compiler itself with:

$ cargo make

To build just the compiler:

$ cargo make midenc

Testing

To run the compiler test suite:

$ cargo make test

This will run all of the unit tests in the workspace, as well as all of our lit tests.

Packaging

TBD

Dependencies

~0.4–1MB
~23K SLoC