frostney / frostney/GocciaScript

Evaluate JIT options (copy-and-patch vs MIR) and recommend go/no-go

Open
#863 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
Pascal
Stars
20
Forks
3
Avg merge
3d 4h
Merged PRs (30d)
45

Description

Summary

Spike: evaluate whether a JIT is worth pursuing, which technique, and at what cost — then recommend go / no-go. Investigation and a one-hot-loop prototype, not production engine code.

Why

Throughput parity with reference embeddable engines is reachable without a JIT — those engines are bytecode interpreters — so the near-term levers are value unboxing (#860) and deeper inline caches (#861). A JIT only matters beyond that, and it is in tension with the sandbox-first posture: a JIT writes executable memory at runtime, which is exactly the dynamic code generation the engine disables by default (eval and the Function constructor are off unless explicitly opted in).

Current behavior

No JIT; a register bytecode VM with shape-validated, monomorphic inline caches.

Expected behavior

A written recommendation covering:

  • Whether the non-JIT path (#860/#861) reaches the throughput target first (expected: yes).
  • If pursued: copy-and-patch (low effort, as shipped in CPython 3.13) vs MIR (a small C JIT library) as the front-runners, with a one-hot-loop prototype measuring the realistic ceiling.
  • The W^X / attack-surface cost, and whether a JIT must be opt-in-only (like --unsafe-ffi) or a separate non-sandbox build.
  • A clear verdict: non-goal / opt-in-only / pursue.

Scope notes

  • Deliverable is a design doc + recommendation. Parent #822.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the current register bytecode VM and the throughput work in #860 and #861. Compare copy-and-patch with MIR using a one-hot-loop prototype, and document the throughput ceiling, W^X and attack-surface implications, and sandbox or opt-in constraints. Done means a design document with a clear non-goal, opt-in-only, or pursue recommendation under parent #822.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.