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
| Feature | Status | Meanwhile |
|---|---|---|
Vector literals (var v: [i32] = [1, 2, 3]) | Type-check and compile, but do not link: the built-in vector constructors are not implemented yet | Use an array [T; N] or a slice [T;] |
Set literals {a, b} | Not compiled | — |
Map literals {k: v} | Not compiled | — |
File-scope var | Not compiled | Move the variable into a function, or use eval for constants |
Initializing a const field in a constructor | Not 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 SC116E | Make 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 yet | Dispatch 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 SC123E | Put 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 yet | Use a file-scope static variable |
An initializer on a static, eval or array-typed field | Rejected with SC116E | Initialize 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 SC116E | Repeat 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
extendoutside the type’s file, or anextend ... implin 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 ... implthat is missing interface methods is not reported at theextenddeclaration. 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
stringcannot be passed to a Cconst 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.