Skip to content

Add minimal VM execution loop for core opcodes #41

@synapticvoid

Description

@synapticvoid

Summary

Implement the first VM runtime loop capable of executing core stack-based bytecode.

Scope (MVP)

  • VM state:
    • value stack
    • instruction pointer
    • globals table
  • Execute initial opcodes:
    • constants/literals
    • local/global get/set/define (minimal form)
    • arithmetic/comparison
    • jump and jump-if-false
    • return
  • Basic runtime error reporting (invalid opcode, stack underflow, type mismatch)

Out of Scope

  • AST compiler/lowering
  • User function call frames beyond minimal return path
  • Struct/enum constructors and method dispatch
  • try/catch error propagation semantics

Acceptance Criteria

  • Hand-authored bytecode programs evaluate correctly (arithmetic, branches, variables)
  • VM reports clear runtime errors for invalid programs
  • Basic tests cover happy path + at least one runtime error case

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