Expand description
Binary bytecode container format (.mailangbc).
Layout (all multi-byte integers little-endian):
magic: b"MAILBC01" (8 bytes)
version: u16 (currently 1)
flags: u16 (reserved, 0)
main: u32 (main chunk index)
n_globals: u32
for each global: u32 len + utf8 bytes
n_chunks: u32
for each chunk:
name: u32 len + utf8 bytes
n_const: u32
for each constant: Value
n_instr: u32
for each instruction: opcode u8, has_operand u8, operand u32 (if has_operand), line u32Value tags (u8): 0 Null, 1 Bool, 2 Int, 3 Float, 4 Str, 5 Char, 6 Array, 7 Map, 8 Tuple, 9 Function, 10 Closure, 11 Class, 12 Instance, 13 Ok, 14 Err, 15 Some, 16 Builtin