Changelog
This page summarizes the user-visible changes in each minor release.
Patch-level entries (0.10.81, 0.10.80, etc.) ship internal fixes,
new examples, and SPOJ algorithm solutions, and are tracked in the
full CHANGELOG.md
on GitHub.
If you are upgrading from one minor to the next, the items below are the ones to read.
v0.10 — current train
Highlights
- The first release where every "core feature" advertised on the homepage actually ships in the same binary: agents, streams, generative AI, dataset queries, transpilation, and the test runner.
- Bytecode optimizer rewrite. Constant folding and dead code elimination now run on the SSA form before bytecode is emitted, cutting the size of compiled scripts by 10 to 30 percent on the example corpus and shaving startup time on cold runs.
- Standard library expansion. Added
time,crypto/sha256,path/filepath, andregex/matchmodules. The prelude grew helpers likededup,chunks,zip,enumerate, and thesafe_to_int/safe_to_floatfamily that returnsT | nilinstead of panicking. - Stabilized the Docker image at
ghcr.io/mochilang/mochi. The image is now multi-arch (amd64, arm64) and pulls under 30 MB. - MCP server (
mochi serve) gained tool descriptions, structured output, and an--httpflag for plain HTTP JSON-RPC alongside the default stdio transport. - Hundreds of new programs under
examples/, including a complete SPOJ algorithm corpus that doubles as the transpiler test suite.
Compatibility notes
printno longer adds a trailing space between arguments by default. Useprint(a, " ", b)if you need explicit spacing.list.sortreturns a new list instead of mutating in place. The in-place form isxs.sort_inplace(). This makeslet sorted = xs.sort()do what you expect.- The dataset query now requires
selectat the end. A barefrom x in xs where p(x)no longer compiles; writefrom x in xs where p(x) select xto get the previous behavior.
v0.9
Added
- Dataset query expressions:
from / where / select / sort by / take. Joins usefrom a in xs from b in ys where a.id == b.id select .... The query expression composes withmap/filter/reduceand follows the type system end to end. load "file.csv" as Rowandsave xs to "file.json"for CSV, JSON, JSONL, and YAML. Format is inferred from the file extension; override withas csv/as json/as jsonl/as yamlon thesaveclause.- Pipe operator
|:value | fisf(value). Reads left to right and chains naturally withmap/filter/reduce. - Improved type inference for union types.
matcharms now narrow the binding's type, and the compiler tracks narrowing through guarded branches.
Changed
lenis now a free function on every collection type, replacing the per-type method (xs.len()still works as an alias).
v0.8
Added
- Agents (
agent { ... }blocks) and streams (stream Name { ... }) promoted from "experimental" to "stable". The runtime guarantees deterministic event ordering within a single agent and atomic state mutations across handlers. intentblocks expose agent methods as MCP tools. An agent withintent count(): intbecomes a callable tool over MCP without any glue code.mochi serveruns an MCP server.--stdiois the default transport;--httpadds JSON-RPC over HTTP for editor and CLI clients.- Tool calling inside
generate text { ... }. Tools are declared as functions with adescription:field and get wired into the generation loop automatically.
Changed
emitno longer needs theStreamprefix when the type is unambiguous. Old:emit Message { from: "x" }; new:emit { from: "x" }when the surrounding handler accepts only one stream type.
v0.7
Added
generate text { ... }andgenerate embedding { ... }as expressions in the grammar. The block acceptsprompt,model,temperature,max_tokens, and tool definitions.model name { provider: ..., name: ..., temperature: ... }declarations for one-time provider configuration. Reference the model by name from anygenerateexpression.as <Type>suffix for structured output.generate text { ... } as Planreturns a typedPlanvalue, with the runtime handling JSON schema generation and decoding.- Streaming response support. The runtime exposes the streaming bytes through a built-in iterator when needed, while the default shape is still a single value.
v0.6
Added
- Package system:
package,export, andimport "./path" as alias. Packages are directories of.mochifiles; onlyexport- prefixed declarations are visible across packages. - FFI through
externdeclarations.extern fun call_python(...): ...lets a Mochi program call a Python function with marshalling generated at the boundary. The Go FFI uses the same syntax. - Transpilation to Go, Python, and TypeScript via
mochi transpile main.mochi --to <lang>. Each target produces idiomatic code that passes the language test suite.
v0.5
Added
- Agents (
agent { ... }) withon Event as e { ... }handlers. Initial release of the reactive subsystem. - Streams (
stream Name { ... }) for typed event schemas. emitkeyword for publishing events into the running system.- MCP integration in
mochi serve. First-pass support; tool description fields landed in v0.8.
v0.4
Added
- Union types (
T | nil,A | B) with exhaustiveness checking. matchexpressions with binding patterns and guards.- Destructuring assignment in
letandvar:let {x, y} = point,let [a, b, c] = xs.
v0.3
Added
typedeclarations for structs with inline methods.- Closures and arrow function syntax (
fun(x) => x + 1). Closures capture variables by reference and are first-class values. forandwhileloops withbreakandcontinue.- Range expressions:
0..n(half-open) and0..=n(inclusive).
v0.2
Added
- Static type checking. Every expression has a type at compile time.
- The
let/vardistinction (immutable vs mutable bindings). test "name" { ... }blocks withexpectassertions, runnable viamochi test.
v0.1
Added
- Initial release.
- Bytecode VM and tree-walking interpreter.
fundeclarations,if/else,return.list<T>andmap<K, V>collection types.- Built-in functions:
print,str,len, basic numeric helpers.
See also
- Roadmap for what is shipping next.
- Manual for the language reference.
- Full CHANGELOG.md on GitHub for every patch release.