HIBANA Mark

HIBANA

Affine Multiparty Session Types for Rust

Rust 2024 • no_std • no-alloc-oriented • affine endpoint progress

HIBANA

Affine Multiparty Session Types for Rust

Rust 2024 • no_std • no-alloc-oriented • affine endpoint progress

Choreography-first endpoint progress for Rust.

Hibana lets a protocol crate describe communication once as a global choreography, project each participant into a compact resident descriptor, attach transport, storage, and resolver policy through hibana::integration, and hand application code a small affine Endpoint. Applications stay on hibana::g and Endpoint; protocol crates use hibana::integration to project, attach, and bind.

Status: hibana 0.6.2 is published on crates.io. The core crate is ready for early protocol integration.

use hibana::g;

// 1. Write one global choreography.
let app = g::seq(
    g::send::<g::Role<0>, g::Role<1>, g::Msg<1, u32>, 0>(),
    g::send::<g::Role<1>, g::Role<0>, g::Msg<2, u32>, 0>(),
);

// 2. Protocol crates project, attach transport, and return Endpoint.
// 3. Applications drive only the localside path.
endpoint.flow::<g::Msg<1, u32>>()?.send(&7).await?;
let reply = endpoint.recv::<g::Msg<2, u32>>().await?;

Choreography First

hibana::g builds protocols with send / seq / route / par. Projection turns one global shape into per-role programs.

Affine Endpoint

flow().send(), recv(), offer(), and RouteBranch::decode() advance only the projected continuation.

Two Public Surfaces

Application code uses hibana::g and Endpoint. Protocol crates use hibana::integration.

no_std Core

Rust 2024 · #![no_std] · no_alloc-oriented — caller-provided storage, resident descriptors, and attach sizing derived from projection.

No Shared Protocol State

Protocol state is affine endpoint ownership. Shared memory, atomics, globals, and side channels are not route or loop authority.

Fail Closed

Endpoint errors are evidence, not route arms. Operational deadlines poison a generation; protocol-visible time is an explicit choreography route.

Crates and Demos

hibana is the core crate. Downstream crates prove concrete integration without expanding the core API.

hibana Core

Const-projected affine MPST runtime, resident descriptor attach, endpoint progress, resolver policy, and protocol-neutral integration surface.

crates.io/crates/hibana · github.com/hibanaworks/hibana

hibana-pico Proof Target

WASI P1 projection, attach, and run proof target for choreography-owned endpoint/carrier progress on embedded hardware.

github.com/hibanaworks/hibana-pico

hibana-mgmt Planned

Management choreography prefixes and payload owners for protocol crates that need operational control flows.

github.com/hibanaworks/hibana-mgmt

hibana-epf Planned

Policy-slot appliance for bytecode verification, installation, and execution outside the Hibana core crate.

github.com/hibanaworks/hibana-epf

Get Started

cargo add hibana
[dependencies]
hibana = "0.6.2"

crates.io · docs.rs · GitHub