Skip to content

Add AST-to-bytecode compiler for expression core with parity tests #42

@synapticvoid

Description

@synapticvoid

Summary

Compile the existing expression/core statement subset from AST into bytecode and validate parity against the current interpreter.

Scope (MVP)

  • Lower from typed AST to bytecode for:
    • literals
    • unary/binary expressions
    • var declaration/get/set
    • block expressions
    • if expressions (with jumps)
    • expression statements
  • Wire compile+run path behind a VM entry point
  • Add parity test harness:
    • run same source via current interpreter and VM
    • compare value/output for supported subset

Out of Scope

  • Full function declaration/calls if too large for first slice (can be follow-up)
  • Struct/enum/error unions/try/catch lowering
  • import system and module linking

Acceptance Criteria

  • Supported subset programs compile and run on VM
  • Parity tests pass against interpreter for supported subset
  • Compiler emits useful errors for unsupported AST nodes

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