Kairo Core
Kairo Core is always available — you never need an import statement to use its prelude types. These are the foundational primitives and collections that every Kairo program can rely on, regardless of package type or target environment.Prelude types (no import required)
The following types are in scope automatically in every Kairo file:Bool— boolean true/false valuesText— the primary text type in Kairo (see note below)Int32,Int64— fixed-width integer typesDecimal— the default type for fractional literalsFloat64— IEEE 754 double-precision float; requires explicit typingDate,Time,DateTime,Instant,Duration— comprehensive date and time primitivesList<T>,Set<T>,Map<K, V>— immutable collection typesMutableList<T>,MutableSet<T>,MutableMap<K, V>— mutable collection variantsResult<T, E>— typed error handling
Text, not String — Kairo’s primary text type is Text. There is no String type in Core. If you see String in Kairo code, it does not refer to a built-in.Decimal, not Float64 by default — Fractional literals such as 3.14 are typed as Decimal unless you explicitly annotate them as Float64. Use Float64 only when you have a specific reason to prefer binary floating-point arithmetic.What is NOT in Kairo Core
Core is intentionally minimal. The following capabilities are not provided by Core and must be sourced from Pulse or Astra packages:- JSON and XML processing
- File system access
- HTTP client or server
- Database access
- Application configuration
- Cryptography
- Monetary values (
Moneyis not a core primitive) - Console/stdout output
Pulse Runtime Services
Pulse Runtime Services are available in all application packages — they ship alongside the Pulse runtime and do not require a manifest dependency. However, each module must be explicitly imported before use. Pulse is not a keyword or global; you must bring each module into scope with animport statement.
Available Pulse modules
Pulse.Console
Pulse.Console is your gateway to standard output and standard error. Import it at the top of any file that needs to write to the console.
Pulse.Console.out — writes to stdout:
.writeLine(text: Text)— writes the value followed by a newline.write(text: Text)— writes the value without a trailing newline
Pulse.Console.error — writes to stderr:
.writeLine(text: Text)— writes the value followed by a newline.write(text: Text)— writes the value without a trailing newline
out and error accept Text, Bool, Int32, Int64, Decimal, Float64, enum values, and value or object instances.
Astra First-Party Packages
Astra packages are optional, first-party libraries published by Astra Kairo. They are not bundled with the toolchain or runtime — you must declare each one as an explicit dependency in yourkairo.toml manifest before you can use it. Once declared, add the corresponding import statement in any file that needs the package.
Available Astra packages
Astra.Money
Monetary values and arithmetic.
Money is not a Core primitive — use this package whenever your domain requires currency-aware types.Astra.Json
JSON serialization and deserialization. Convert Kairo values to and from JSON text.
Astra.Xml
XML parsing and generation. Work with XML documents, elements, and attributes.
Astra.Configuration
Application configuration loading. Read structured configuration from files or environment sources.
Astra.Http
HTTP client and server. Make outbound requests and handle inbound HTTP traffic.
Astra.Cryptography
Cryptographic primitives. Hashing, signing, encryption, and secure random generation.
Astra.FileSystem
File system access. Read, write, and navigate files and directories.
Astra.Database
Database access. Connect to and query relational and other database systems.
Money is not a primitive in Kairo Core. Astra.Money is the canonical source for monetary values in Kairo applications. If your domain models prices, balances, or any currency-denominated quantity, declare Astra.Money as a dependency.Adding an Astra package
To use any Astra package, add it to the[dependencies] section of your kairo.toml and then run forge restore to fetch and register the package.
Astra package documentation expands as each package stabilizes. Check the individual package reference pages for the most up-to-date API details.
