Skip to main content

byteflow/bytecode/
mod.rs

1//! Instruction set, `.bf` (BFV0) wire format, assembler and verifier.
2//!
3//! Pure data plane — no threads, no mailboxes. The scheduler and VM consume
4//! [`Chunk`] values produced here.
5//!
6//! | Piece | Purpose |
7//! |-------|---------|
8//! | [`Opcode`] / [`Instruction`] | ISA (opcodes are **append-only**) |
9//! | [`Value`] / [`Message`] | Runtime / constant-pool tags (ABI versioned) |
10//! | [`Program`] / [`Fn`] | Host-side assembler with named registers |
11//! | [`encode`] / [`decode`] | `.bf` module bytes (`MAGIC` + [`ABI_VERSION`]) |
12//! | [`verify`] | Structural checks before a [`crate::Runtime`] starts |
13//!
14//! Current ABI: see [`ABI_VERSION`] (FlowCap + `Str` / `Bytes`).
15
16pub(crate) mod builder;
17mod chunk;
18mod disasm;
19mod program;
20mod format;
21mod instruction;
22mod macros;
23mod opcode;
24mod value;
25mod verify;
26
27pub use program::{Fn, FuncId, Label, Program, Reg, RegWindow};
28pub use chunk::{Chunk, FunctionDef, ABI_VERSION, MAGIC};
29pub use disasm::disassemble;
30pub use format::{decode, encode, FormatError};
31pub use instruction::Instruction;
32pub use macros::asm_macros;
33pub use opcode::Opcode;
34pub use value::{Message, Value};
35pub use verify::{verify, VerifyError};