Hibana is a choreography-derived runtime enforcement kernel for Rust that projects a single global choreography into compact per-role programs and enforces each step at runtime. It is designed for constrained and embedded targets: unconditionally no_std, allocator-free, and using caller-provided storage. Protocol state lives in compact descriptors rather than proliferating endpoint types, so many sessions reuse the same projected artifact without type growth. Features include support for up to 256 roles (u8 domain), asynchronous send/seq/par/binary route/guarded roll constructs, affine endpoints (can be dropped but cannot publish progress twice), and transport-neutral integration via a Transport trait. Hibana enforces local protocol conformance at each attached endpoint, documents the carrier/deployment/codec/scheduling conditions needed for a distributed guarantee, and does not implement a network stack or distributed algorithm itself.
The workflow is: write a global choreography in the provided DSL, call project(&choreography) per role to get compact RoleProgram descriptors, attach roles to a SessionId, then drive Endpoint::send/recv/offer to commit exactly one permitted step or fail the session. Public surfaces split responsibility: hibana::g and Endpoint/RouteBranch/EndpointError for role implementations, and hibana::runtime for projection, storage, attachment, and resolvers. Projection rejects unsupported route shapes, ambiguous simultaneous operations, conflicting parallel lanes, empty parallel arms, and unguarded re-entry. Explicit resource and descriptor limits are enforced (roles 256, event identities 65,535, program image 65,535 bytes, atom-only program ≈7,281 events, role image 65,535 bytes). Example code (ping_pong) ships with the crate; Rust 1.95+ is required and the crate has no normal dependencies.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.