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
| Page | Covers |
|---|---|
| Variables & Constants | let, const, and shadowing |
| Primitive Types | int, float, str, and bool |
| Operators | Arithmetic, comparison, logic, and bit operations |
| Blocks & Scope | Blocks are expressions; what a scope can see |
| Unit & Never Types | (), !, and what “no value” means |
| Control Flow | if and if let, match, the three loops, and collect |
| Collections | Arrays, dictionaries, tuples, and the in operator |
| Options | T?, null, and the operators that handle them |
| Results & Error Handling | T!, raise, and absolve |
| Functions & Closures | Declarations, defaults and named arguments, closures |
| User-Defined Types | Structs, enums, and impl blocks |
| Pacts | Abstracting over types without generics |
| Privacy | pub and the module boundary |
| Modules | Declaring, nesting, and importing |
| Scripts | No main; files run top to bottom |
| Memory | Garbage collection and its limits |
| Notable Exclusions | What mimas leaves out, and why |