Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Language Reference

This is the complete reference for the mimas language in version 0.1.0. It describes the syntax and mechanics of the language itself – the parts you write in a .mim file. Extending mimas from Rust is covered separately in Extension with Rust.

Each page introduces one concept with short examples. Most are complete programs you can drop into a file and run; a few are fragments or deliberate errors, noted where they appear:

mimas example.mim
PageCovers
Variables & Constantslet, const, and shadowing
Primitive Typesint, float, str, and bool
OperatorsArithmetic, comparison, logic, and bit operations
Blocks & ScopeBlocks are expressions; what a scope can see
Unit & Never Types(), !, and what “no value” means
Control Flowif and if let, match, the three loops, and collect
CollectionsArrays, dictionaries, tuples, and the in operator
OptionsT?, null, and the operators that handle them
Results & Error HandlingT!, raise, and absolve
Functions & ClosuresDeclarations, defaults and named arguments, closures
User-Defined TypesStructs, enums, and impl blocks
PactsAbstracting over types without generics
Privacypub and the module boundary
ModulesDeclaring, nesting, and importing
ScriptsNo main; files run top to bottom
MemoryGarbage collection and its limits
Notable ExclusionsWhat mimas leaves out, and why