Skip to content

v0.2.0-alpha

Choose a tag to compare

@github-actions github-actions released this 21 Aug 14:03
· 127 commits to main since this release

Added

  • Phase 5 JIT (spec §19.2): new prima-jit crate compiles numeric scalar MFn bodies (ExprDAG → bytecode → cranelift IR → native) with cranelift; the interpreter auto-compiles a numeric MFn after 100 numeric calls (or on the first call with the @jit annotation), and runs it natively (f(to_f64(101)) after a 1..100 warm-up loop goes native).
  • jit(...) builtin: returns a callable Value::JitFunction for an MFn name, a symbolic expression, or grad(f) — single-output forward compilation, multi-variable reverse-mode gradient, with an interpreted fallback when compilation is unavailable (spec §19.2 composable optimization).
  • Automatic differentiation (spec §19.4 stages 2–3): forward-mode dual numbers (ad::forward_derivative) and reverse-mode tape (ad::Tape) over numeric scalar DAGs; the tape powers jit(grad(f)).
  • Optimization pipeline (spec §10.2): core::opt constant folding + CSE (hash-consing shares subexpressions); interpreter tail-call optimization for host fn bodies ending in a direct return f(args) (trampolined, constant stack space).
  • C ABI export: prima compile --emit-c-abi builds a real shared library (cdylib shell crate re-exporting @c_api::extern functions via the interpreter) plus its C header (spec §18.4/§19.3).
  • prima_runtime::capi::call_file_export: thread-cached evaluation of a .pra module followed by an exported-function call, powering the C ABI wrappers.
  • Criterion benchmark bench_jit comparing interpreted vs compiled (JIT) evaluation of x^4 + sin(x)*x + exp(x) (≈11× faster native; spec §19.2 acceptance).
  • Reference examples examples/jit.pra and examples/autodiff.pra for hot-path JIT and automatic differentiation.
  • Release workflow now also builds a selection of Tier-2-with-host-tools targets: x86_64-unknown-linux-musl, aarch64-unknown-linux-musl, riscv64gc-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, powerpc64le-unknown-linux-gnu, s390x-unknown-linux-gnu.