
General-purpose compilers can't see the math
To GCC, a * b % p is three integer instructions. C and Rust give you no way to say that p is a prime modulus, and no analysis recovers what the language could not express.
- gcc
- rustc
- clang
Build cryptographic applications in Python. Compile them into highly optimized execution for modern hardware.
Awesome Zorch
General-purpose compiler optimizations weren't designed for finite fields, polynomial arithmetic, or proof systems.

To GCC, a * b % p is three integer instructions. C and Rust give you no way to say that p is a prime modulus, and no analysis recovers what the language could not express.

XLA reshapes whole programs around tensor algebra over floats. Nothing in it can say "this u32 is a field element," so an optimization like lazy reduction never comes up.

A hand-tuned kernel knows the math, but couples one operation, whether MSM, NTT, or a hash, to one GPU. Research moves fast and hardware faster, so that code rarely lives long enough to reuse.

AI is good at local, profiling-guided tuning. But lazy reduction and fusion are global decisions across the whole computation graph, which it does not see. A compiler optimizes the graph, not the snippet.
| gccrustcclanggcc · rustc · clang | xlatvmtritonxla · tvm · triton | iciclespparkicicle · sppark | AI codingagentsAI coding agents | zorchzorch | |
|---|---|---|---|---|---|
| Field-aware semanticsfinite fields, not integers | |||||
| Whole-graph optimizationlazy reduction, fusion | |||||
| Hardware portabilitysame source, next GPU | |||||
| Math-level sourcereads like the paper, not tuned CUDA | |||||
| Algorithm agilitynew scheme, no new kernels |
Explore real-time benchmark data on compilation throughput, compute cost reduction,
and verification latency compared with manual optimization.
One pipeline: a Python framework for SNARKs, lowered through StableHLO and
optimized all the way down to CPU and GPU kernels.
Build a SNARK in Python: define your IOP rounds and compose them. You write the protocol, and never touch the kernels.
A JAX-based runtime that traces your Python into a graph and lowers it to StableHLO, carrying field types, not floats.
Runs a full optimization pipeline over the whole graph, from fusion and layout to lazy reduction, treating it as one program.
An MLIR layer that lowers the optimized graph into kernels and tunes the generated code for each CPU and GPU target.