Jda v1.1.0 — macOS Native Backend + 6.6× LZ77 Win Over C

Jda v1.1.0 is out. This release ships the macOS native compilation backend and a set of compiler optimizations that push Jda ahead of C, Rust, and Go on two of five real-world benchmarks — while running via Rosetta 2 x86-64 on Apple Silicon.

macOS Native Backend

jda build --macos now emits x86-64 Mach-O binaries that run directly on macOS after a codesign -s -. Syscall numbers are translated automatically from Linux to macOS BSD at JIR emit time — user programs don’t change.

jda build --macos sudoku.jda -o sudoku
codesign -s - sudoku
./sudoku < puzzles.txt
# solved: 500/500
# time: 41 ms

Benchmark Results — Apple Silicon (ms, lower is better)

C, Rust, and Go compile to native ARM64. Jda runs x86-64 via Rosetta 2.

BenchmarkCRustGoJda
Sudoku — 500 puzzles62626641
LZ77 — 1 MB compress1,8302,1852,721277
Regex — 8 pats × 100K98221813186
B-Tree — 1M ops282297318586
Raytracer — 800×600192135331

Sudoku: Jda 1.5× faster than C/Rust — constraint propagation with bitmasking, DCE, and loop register promotion.

LZ77: Jda 6.6× faster than C. Two optimizations do the work: MOD→AND strength reduction eliminates every IDIV in the hash-chain inner loop, and loop-invariant code motion hoists the max-length and first-byte filter out of the match scan. C, Rust, and Go all keep the slower form.

See the full analysis for per-benchmark breakdowns and source code in all six languages.

Compiler Optimizations

  • Global copy propagation — OP_COPY elimination across basic block boundaries (~6.5% on btree)
  • MOD→AND strength reductionx % pow2x & (pow2-1), fires on all pow2 moduli
  • MULQ magic multiply — constant non-pow2 modulo via ceil(2⁶⁴/d) multiply, ~5× faster than IDIV
  • Const-eviction regalloc — constants given last-use=∞ to prevent register eviction
  • Global DCE — unreachable top-level functions eliminated before codegen

Self-Hosting

The compiler compiles itself and produces a byte-identical binary at 2,050,465 bytes. 388 conformance tests passing.

Download

curl -sSf https://jdalang.org/install.sh | sh