Skip to main content

Jun 2025 (v0.4.0)

Mochi v0.4.0 introduces asynchronous streams for declarative event processing. Programs can define stream types, emit events, and handle them with on blocks. The runtime queues events and executes handlers deterministically.

Streams

stream Sensor { id: string, temperature: float }

on Sensor as s {
print(s.id, s.temperature)
}

emit Sensor { id: "sensor-1", temperature: 22.5 }

Other Changes

  • Refactored stream runtime with interfaces
  • Go, Python and TypeScript compiler support
  • Async interpreter handlers
  • Updated syntax highlighting for keywords
  • Visual Studio Code extension with syntax highlighting and agent integration