Mochi is a statically typed, expression-oriented language. It compiles to compact bytecode, ships agents and streams as keywords, and treats AI generation as a first-order construct.
curl -fsSL get.mochi-lang.dev | sh// no main needed, programs run top to bottom
let greeting = "Hello, " + name + "!"
print(greeting)
// strongly typed, inference does the work
fun greet(user: string): string {
return "welcome, " + user
}
// agents react to events
agent inbox {
on message(text: string) {
emit reply(greet(text))
}
}
Each tab is a complete Mochi file. Copy, paste, and run.
Six properties that the language and toolchain commit to. Every other feature is built on top of these.
Type inference covers most annotations. Bindings are immutable by default. Programs run top to bottom with no main function and no class wrapper.
agent, stream, and intent are keywords, not a framework. Build event-driven systems without a message bus or actor library.
Call language models with a generate block. Configure providers with a model declaration. Tool calling and structured output need no SDK.
Query lists with from / where / select / join. Read and write CSV, JSON, JSONL, and YAML with one keyword.
Compiles to compact bytecode with constant folding and liveness-based dead-code elimination. One static binary, no runtime dependency.
test and expect blocks live alongside the code they cover. No framework, no separate runner. Run mochi test and the tests run.
Pick the path that fits your environment. Mochi ships as a single binary, in a Docker image, and as source.
Download a single static binary for your platform. The fastest path from zero to running Mochi code.
curl -fsSL get.mochi-lang.dev | sh
mochi --version
mochi run -e 'print("ready")'
Mochi is small enough to read in an afternoon. These are the next places to go.
A tour of the language: variables, functions, types, agents, AI generation, and datasets.
Read the manualReferenceConcise grammar, operator table, statement reference, and an index of every built-in function.
Open the referenceTutorialWalk through a complete Mochi program from a blank file: types, functions, tests, and a CLI entry point.
Start the tutorialExamplesHundreds of small programs covering agents, datasets, AI, algorithms, and transpilation targets.
Browse on GitHubRoadmapPhased plan covering the core language, tooling, transpilation targets, and the path to v1.0.
See the roadmapCommunityAsk questions, share what you build, and report bugs in the open with the rest of the community.
Join the discussion