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//! | [`ChunkBuilder`] | Host-side assembler with label back-patching |
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
16mod builder;
17mod chunk;
18mod disasm;
19mod format;
20mod instruction;
21mod macros;
22mod opcode;
23mod value;
24mod verify;
25
26pub use builder::{ChunkBuilder, Label};
27pub use chunk::{Chunk, FunctionDef, ABI_VERSION, MAGIC};
28pub use disasm::disassemble;
29pub use format::{decode, encode, FormatError};
30pub use instruction::Instruction;
31pub use macros::asm_macros;
32pub use opcode::Opcode;
33pub use value::{Message, Value};
34pub use verify::{verify, VerifyError};