v3 Bytecode Format (BC2)

BC2 contract

  • BC2 header required
  • FUNC <id> <name> <params...> sections
  • MAIN section required
  • each section ends with END

Function identity

  • function IDs are numeric handles
  • IDs must be unique
  • IDs are used by MAKE_CLOSURE and linker offset rewriting

Instruction syntax

  • mnemonic + optional immediates
  • no separators beyond whitespace
  • decode validates argument count/type by opcode

Validation discipline

  • unknown opcode
  • bad integer values
  • mismatched END
  • missing MAIN
  • section order/structure errors

Why BC2

  • stable human-readable artifact
  • deterministic roundtrips
  • decouples compiler and VM

Good checks

  • deterministic encode/decode
  • stable error messages
  • explicit function metadata and init bytecode shape
1 / 1
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.