Implementation Status

Implementation Status

The language reference describes Kairo as designed. This page lists where the current compiler falls short of it. Each entry is removed when the gap closes.


Not Compiled Yet

FeatureStatusMeanwhile
Vector literals (var v: [i32] = [1, 2, 3])Type-check and compile, but do not link: the built-in vector constructors are not implemented yetUse an array [T; N] or a slice [T;]
Set literals {a, b}Not compiled—
Map literals {k: v}Not compiled—
File-scope varNot compiledMove the variable into a function, or use eval for constants
Initializing a const field in a constructorNot supported—
Non-generic payload enums whose payload has a type with unknown copy, move and destruction (enum W { Has { b: Box<i32> } } for a generic class Box)Rejected with SC116EMake the enum generic over the payload type
Associated types (type Node in an interface)Not parsed yet—
Virtual interfaces (virtual interface, calls through *Iface)Not compiled yetDispatch through a base class with virtual methods
Binding a MOVE-category value to a new name (var b = a)Not compiled yet: it fails in the C++ step today—
Shorthand .V as the LEFT operand of == / != (.North == dir)Rejected with SC123EPut the variable first: dir == .North
A declared underlying type on a payload enum (enum E derives u8 { A { x: i32 }, B })Accepted and ignored: the tag is always u32—
Static fields (static count: i32 in a class)Type-check, but do not link: no definition is emitted yetUse a file-scope static variable
An initializer on a static, eval or array-typed fieldRejected with SC116EInitialize it in a constructor (array) or use a file-scope eval (static/eval)
A generic record’s field default that reads another field (class <T> G { var a: i32 = 1 var b: i32 = a + 1 })Rejected with SC116ERepeat the value instead of reading the field

Checked by C++, Not by Kairo

Access control is enforced, but the error comes from the C++ compiler at build time rather than as a Kairo diagnostic. This covers priv constructors and writes to const fields.


Not Diagnosed

Passing a slice literal to a function that stores the slice is not caught. The literal’s storage ends with the statement, so the stored slice dangles. This becomes an error when Tether lands; until then, pass a var or a [T] to any function that keeps what it is given. See Primitives.

Assigning to a const binding introduced by a match pattern (case .Error(const message)) is not reported. See Enums.

Declaring var x: T with no initializer in a generic body is not reported when no bound requires a default constructor. See Generic Bodies.

Three extend rules are not diagnosed yet:

  • A plain extend outside the type’s file, or an extend ... impl in neither the type’s nor the interface’s file, is accepted. See Same-File Restriction.
  • Calling an extension member whose bounds the type arguments do not satisfy is not reported at the call site. See Generic Extends.
  • An extend ... impl that is missing interface methods is not reported at the extend declaration. See Interface Conformance.

A generator that outlives the object it was created from, or an @inout argument it was given, is not caught; it dangles. This becomes an error when Tether covers generators. Until then, do not keep a generator longer than the object it came from.


Language Gaps

  • A Kairo string cannot be passed to a C const char* parameter; string.c_str() is planned. See C & C++ Interoperability.
  • Evaluation order is left to right for arguments, except for calls returning a C++ reference or class object and for primitive operators whose two operands both have side effects. See Operators.