Reference
Documentation
Look up a language rule, find a module’s source, or see how the compiler checks and runs a program.
Browse source
For an implementation, open a module or an example below. For syntax, start with the parts of a program. For a worked explanation, follow a concept instead.
- Standard library sourceChoose a module to read the source that ships with the compiler.
- Example sourceBrowse the programs, contracts and helper files used in the playground.
The language
- Programs and lexical structureWhat an Omegyu source file holds, and how its text is read into comments, names, keywords, numbers, texts and symbols.
- Functions and definitionsFunctions, implicit arguments, definitions, annotations and holes, and the definitions that work at every universe level.
- UniversesTypes as values, the hierarchy of universes, universe levels and the definitions that abstract over them, Typeω, and the impredicative bottom universe.
- DataThe builtin types of data and their operations, words of a given width, the eliminators that recursion goes through, and pairs.
- RecordsRecords and record types, the operations that select, replace, remove and add fields, scoped labels, and the empty record of each universe.
- UnionsUnion types and their alternatives, merge and otherwise, alternatives without a payload, the empty union, and widening to a larger union.
- RowsRows as first-class values, row polymorphism over records and unions, rows of capabilities, and the record types that a row lifts to a higher universe.
- ReflectionReflect, the typed descriptions of types that the elaborator derives, the fold that consumes them, and the operations on rows and the laws that come with them.
- OperatorsThe operators of the builtin types, from the loosest to the tightest, and the operators that a record in scope gives to other types.
- Equality and proofsEquations as types, refl and assert, proofs of computed constraints as implicit arguments, propositions as types, and proofs about numbers with std:Arith and std:Ring.
- Actions and do blocksValues of type IO, the do blocks that sequence them in any monad, IO/loop, and how omegyu run carries an action out.
- ImportsThe locations that an import names, sources as values of std:Import.Source, requests with headers and TLS settings, integrity hashes and freezing.
- GrammarThe grammar of Omegyu's expressions, from the constructs that extend as far as they can to the atoms and the imports.
- BuiltinsThe types, constructors, eliminators and operations that the kernel provides, with the types that the compiler gives them.
- The standard libraryImport a module, find an operation in its source, and use the same collection at different universe levels.
The compiler
- The omegyu commandThe commands and options of omegyu, the command-line tool that checks, normalises, runs and formats Omegyu programs and compiles contracts.
- The pipelineThe stages that take a source to a checked term, where the cache and the kernel come in, and how a contract becomes EVM bytecode.
- The EVM back endHow omegyu evm build compiles a contract, what it prints and writes, the options of a deployment, and where the contract model and its tests are documented.
- Imports and the cacheHow the compiler loads the sources that a program imports, how a hash pins an import, what the cache of checked modules holds, and what it assumes.
- Checked, tested and assumedWhich guarantees the kernel checks on every program, which ones are proved in Omegyu, which ones tests support, and which ones are assumptions.