Skip to content

Add bytecode and template-based JIT execution tiers #367

@fasterthanlime

Description

@fasterthanlime

Background

Right now the execution model is framed as having interpret on one end and jit on the other. That skips over two useful intermediate levels that would make the runtime architecture easier to reason about and evolve.

Proposal

Add two explicit intermediate execution levels:

  1. bytecode

    • A lowered, executable representation below the high-level interpreter path.
    • Gives us a concrete runtime boundary and a stable target for execution, tracing, dumping, and oracle-style comparisons.
  2. template-based-jit

    • A JIT tier with no optimizing backend at all.
    • Emits machine code from templates or direct codegen patterns, without depending on Cranelift/LLVM-style optimization machinery.
    • Lets us separate "native dispatch/code emission works" from "an optimizing backend can handle this program".

Why

This gives the execution ladder more useful shape:

interpret -> bytecode -> template-based-jit -> jit

The distinction should help keep observability and fallback behavior honest:

  • interpret stays the semantic reference path.
  • bytecode becomes the explicit lowered execution format.
  • template-based-jit proves the native-code path without involving an optimizing backend.
  • jit remains the optimizing backend tier.

That should also make JIT coverage reporting more precise: failures in lowering to bytecode, failures in template emission, and failures in the optimizing backend are different classes of problem and should be visible as such.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions