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 msBenchmark Results — Apple Silicon (ms, lower is better)
C, Rust, and Go compile to native ARM64. Jda runs x86-64 via Rosetta 2.
| Benchmark | C | Rust | Go | Jda |
|---|---|---|---|---|
| Sudoku — 500 puzzles | 62 | 62 | 66 | 41 |
| LZ77 — 1 MB compress | 1,830 | 2,185 | 2,721 | 277 |
| Regex — 8 pats × 100K | 98 | 221 | 813 | 186 |
| B-Tree — 1M ops | 282 | 297 | 318 | 586 |
| Raytracer — 800×600 | 19 | 21 | 35 | 331 |
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 reduction —
x % pow2→x & (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