You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory specifies how the Kairo compiler implements the language: its pipeline, the contract of each pass, the invariants that hold between them, and the known limitations. What a Kairo program means is defined by the language reference; where the two disagree, the language reference states the intended behaviour and the disagreement is a defect.
The directory layout of the sources is in Compiler/README.txt.
Pipeline
source (.k)
-> Lexing and preprocessing Lexing.md
-> Parsing Parsing.md
-> Sema
import resolution Imports.md
expansion, verification,
name resolution NameResolution.md
type resolution, chain
binding TypeResolution.md
expression typing ExprTyping.md
semantic checks SemanticChecks.md
lowering Lowering.md
monomorphization Generics.md
-> Codegen to C++ tokens Codegen.md
-> clang (in process) Interop.md
-> link (lld) Linking.md
The authoritative pass order and the cross-pass invariants are in Pipeline.md.
The serialized AST: one file's parsed tree as bytes, the format, what is rebuilt on read, the round-trip test flags
Language reference
The language reference is maintained on the website (https://www.kairolang.org/docs/language/) and mirrored read-only in Docs/. Spec documents refer to its pages by name; this table is the single place that maps a name to its file.
Page
File
primitives, conversion classes
primitives.mdx, conversion-lattice.mdx
variables
variables.mdx
pointers
pointers.mdx
unsafe
unsafe.mdx
structures
structures.mdx
classes, lifecycle
classes.mdx, classes-lifecycle.mdx
extends
extends.mdx
closures
closures.mdx
functions, parameter modes
functions-parameter-modes.mdx
requires, where
requires.mdx, where.mdx
nullables
nullables.mdx
panic
panic.mdx
C++ exceptions
c-cpp-exceptions.mdx
eval
eval.mdx
imports, modules, scripts
imports.mdx, modules.mdx (Scripts)
interfaces
interfaces.mdx, interfaces-requirements.mdx
generics
generics.mdx
ownership
ownership.mdx
C and C++ interop
c-cpp.mdx, c-cpp-*.mdx
C and C++ ABI
c-cpp-abi.mdx
diagnostics
diagnostics.mdx
macros
macros.mdx, macros-builtin.mdx
Former documents
Older text (tests, commit messages) cites the design notes this directory replaced. Their content now lives here:
Former document
Now
Compiler/Sema/RESOLUTION.md
Pipeline.md, with each pass in its own document; invariant numbers 1-19 are unchanged