Skip to content
nuscrPublic

About

Oven code generation for Rust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

baguette

Baguette generates session-typed Rust APIs for multiparty communication protocols. Given a per-role finite state machine in DOT format (as produced by ovenMPST), it generates a Rust source file where each protocol state is a distinct type and every method consumes self, returning a value of the next state's type. This encoding uses Rust's affine type system to reject programs that skip, repeat, or reorder protocol steps at compile time.

Messages are sent and received over ZeroMQ PUSH/PULL sockets via the included Transport type.

Usage

cargo run -- <input.dot> <output.rs>

Examples

The logging example runs three roles as threads in one process.

cargo run --example logging

The acquire_use_release example has two implementations. The threaded version runs all three roles in one process.

cargo run --example acquire_use_release

The multiprocess version runs each role as a separate executable. See examples/acquire_use_release/README.md for details.

bash examples/acquire_use_release/multiprocess/run.sh

Documentation

See doc/manual.md for a detailed description of the protocol format, transport API, naming conventions, and how to add new protocols.

Building and testing

cargo build
cargo test

About

Oven code generation for Rust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages