Skip to content

Add bytecode chunk format and disassembler #40

@synapticvoid

Description

@synapticvoid

Summary

Add the core bytecode representation used by the compiler and VM, plus a readable disassembler for debugging.

Scope (MVP)

  • Define OpCode enum for initial VM instructions
  • Add chunk/code container:
    • instruction stream
    • constant pool
    • line/source mapping for diagnostics
  • Add helpers to write instructions and constants
  • Add debug disassembler that prints instruction offsets and decoded operands

Out of Scope

  • VM execution loop
  • AST lowering/compiler pass
  • Function call frames and closures

Acceptance Criteria

  • A manually assembled chunk can be created in tests
  • Disassembler prints readable output for opcodes with and without operands
  • Constant references decode to their literal values in disassembly output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions