Skip to main content

Jun 2025 (v0.5.1)

Mochi v0.5.1 introduces ahead-of-time constant folding, memoization for pure functions and typed compiler output. The CLI now includes a built-in cheatsheet for quick reference.

Cheatsheet Command

Run mochi cheatsheet to print an embedded language summary.

mochi cheatsheet

Pure Function Optimization

Use --memo to memoize pure calls at runtime and --aot to fold them before execution.

mochi run --aot program.mochi
mochi run --memo program.mochi

Typed Compiler Output

The Python compiler emits type hints and the TypeScript compiler annotates variables and functions automatically.

Other Changes

  • Interpreter folds constants declared with let
  • Go compiler memoizes pure calls
  • Agent stream example added
  • Compilers skip async overhead when programs have no streams