Skip to main content

June 2025 (v0.2.9)

This update focuses on tooling enhancements, expanding the compilation targets and improving benchmarking infrastructure.

TypeScript Compilation Support

Mochi now supports compilation to TypeScript via the --ts flag:

$ mochi build main.mochi --ts -o main.ts

The generated TypeScript code mirrors the original Mochi semantics and is verified against golden outputs to ensure consistency across releases. This enables integration with existing JavaScript and web tooling while maintaining stability.

Integrated Benchmark Workflow

Benchmarks are now fully integrated into the build process. Templates are compiled to Go or TypeScript and executed automatically. Their outputs are version-controlled to ensure reproducibility and track performance over time.

This workflow simplifies regression detection and allows easier comparisons across backends and configurations.

Optimized Runtime Helpers

The compiler now includes runtime helper functions selectively—only when they are used by the program. This reduces the size of generated output and simplifies downstream bundling, particularly when targeting JavaScript environments.

Documentation Improvements and Timing Precision

Documentation has been expanded to include additional CLI examples and common Makefile targets, making it easier to discover available functionality.

Benchmark timing has also been improved: when running under Deno, the runtime now uses performance.now() for sub-millisecond timing accuracy, ensuring more precise benchmark measurements.