Skip to main content

Jun 2025 (v0.5.0)

Mochi v0.5.0 introduces agents along with enhanced string handling and control flow. Agents keep persistent state, expose intent functions and react to events from streams. Strings can be indexed, iterated and checked for containment. A new while statement rounds out loop constructs.

Agents

agent Monitor {
var count: int = 0

on Sensor as s {
count = count + 1
}

intent status(): string {
return "events = " + str(count)
}
}

Agents integrate with the runtime so external callers can invoke intents while events trigger handlers deterministically.

Strings and Loops

Treat strings like lists of characters:

for ch in "hello" {
print(ch)
}
print("e" in "hello")

Use while for conditional loops when ranges do not apply.

Other Changes

  • Go, Python and TypeScript compilers updated for agents, strings and while
  • Basic agent runtime with interpreter integration
  • Example solutions and documentation updates
  • Fixed a race condition in the agent runtime