Jun 2025 (v0.6.3)
Mochi v0.6.3 introduces packages for organizing code, new CLI utilities and improved dataset handling across compilers.
Packages
Use package declarations to group files and export to expose definitions. Imports default to the last path segment when no alias is given.
package mathutils
export fun add(a: int, b: int): int {
return a + b
}
import "mathutils"
print(mathutils.add(2, 3))
Dataset I/O
load and save work uniformly in Go, Python and TypeScript compilers for CSV, JSONL, JSON and YAML files.
Module Commands
The mochi CLI adds init to create a new module and get to download dependencies.
Documentation Comments
The parser now attaches preceding line comments to programs and declarations.
libmochi Libraries
Helpers for Go, Python and TypeScript run Mochi code directly from host applications.