Language
Kyllo is a statically typed language in which requirements are written into the program and checked. Every feature carries a status label — Accepted, Proposed, or Unresolved.
The authoritative reference is the Language Guide and the Technical Specification. This page does not replace them.
Type system Proposed
Kyllo is strictly and statically typed. There are no implicit conversions: a value of one type is never silently treated as another. Type inference applies only to intermediate expressions — never to variable declarations, which must state their type.
- Primitive types: Integer, Decimal, Boolean, String, Character, Unit.
- Composite types: Struct, Enum, and collections — List, Map, Tuple.
- Wrapper types: Optional (a value that may be absent) and Result (a value or a failure — see below).
Numeric semantics
Integer Proposed
Signed 64-bit, range −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, with checked arithmetic. Overflow, underflow, and division by zero are explicit failures — there is no silent wrapping.
Decimal Unresolved — OQ-002 open
The draft describes Decimal as “decimal128-compatible”, with 34 significant digits and round-to-nearest, ties-to-even. No IEEE or General Decimal Arithmetic conformance target is established, the exponent range is not given, there is no defined Decimal literal format, and whether 1.50 == 1.5 is not yet defined. There is no NaN or Infinity, and the outcome of Decimal overflow or division by zero is not yet defined.
A proposal to adopt General Decimal Arithmetic v1.70 (precision 34, round-half-even, Emin −6143, Emax 6144) is under consideration. Integer division and remainder (OQ-003) and rounding context (OQ-004) are open questions.
Variables and declarations Proposed
Declarations state their type explicitly. Three declaration kinds:
LET— immutable: the value cannot be changed after it is bound.VAR— mutable: the value may be changed.CONST— compile-time constant.
Example — Accepted OQ-001 (statement termination)
LET balance: Decimal = 100.00;
CONST MAX_RETRIES: Integer = 5;
balance = balance + 25.00;
PRINT(balance);
RETURN balance;
Simple statements and declarations end with a semicolon.
Functions and modules Proposed
Functions declare their inputs and outputs, their contracts (below), and their implementation. Modules are private by default, and dependencies between modules are explicit and versioned. A function signature states what goes in, what comes out, what it requires, and how it can fail.
Example — Accepted OQ-001 (typed block terminators)
FUNCTION calculate() -> Integer
RETURN 42;
END FUNCTION;
Compound structures end with a typed terminator that matches the opening structure. There is no redundant semicolon after a terminator: END FUNCTION;; is rejected. A generic END; is rejected.
Contracts Proposed
Contracts are declarations attached to functions and types:
REQUIRES— preconditions the caller must satisfy.ENSURES— postconditions the function guarantees, which may refer to the old value withOLD(...).INVARIANT— a condition that must hold throughout.EFFECTS— what the function changes.
How far contracts can be checked statically versus at runtime is part of the verification design (see Verification).
Results and errors Proposed
Operations that can fail must return a Result. Failures cannot be silently ignored: the caller must handle the failure case explicitly. A program cannot proceed as if an operation that might fail had succeeded.
Expressions and operators Proposed
Arithmetic (+, -, *, /, %), comparison, and logical operators (AND, OR, NOT) with short-circuit evaluation. Chained comparisons are not allowed.
Compile-time evaluation Proposed
CONST declarations and literals are evaluated at compile time. The MVP scope covers literals and simple deterministic expressions.
Examples
Examples are taken from the documentation, with source and status stated for each.
Simple statements — Accepted OQ-001 · source: decision record OQ-001
LET balance: Decimal = 100.00;
CONST MAX_RETRIES: Integer = 5;
balance = balance + 25.00;
PRINT(balance);
RETURN balance;
Blocks — Accepted OQ-001 · source: decision record OQ-001
IF balance > 0:
PRINT(balance);
ELSE:
PRINT(0);
END IF;
WHILE balance > 0:
balance = balance - 1;
END WHILE;
Semicolons after simple statements; typed END terminators; no redundant semicolon after a terminator; generic END; rejected.
Bank Account deposit — Tutorial · Proposed
FUNCTION deposit(account: Account, amount: Decimal) -> Result<Account, DepositError>
REQUIRES: amount > 0;
ENSURES: result.balance == OLD(account.balance) + amount;
EFFECTS: MODIFY account.balance;
FAILURES: InvalidAmount;
IMPLEMENTATION:
account.balance = account.balance + amount;
RETURN SUCCESS(account);
END FUNCTION;
Type declaration — Proposed
TYPE Account:
id: Integer;
balance: Decimal;
active: Boolean;
END TYPE;
Divide — Proposed
FUNCTION divide(a: Integer, b: Integer) -> Result<Integer, DivisionError>
REQUIRES: b != 0;
IMPLEMENTATION:
RETURN SUCCESS(a / b);
END FUNCTION;
Unresolved syntax
The following forms are unresolved: ENUM, TEST, and PARALLEL block terminators, CONVERT, and named-argument construction. Their terminators and semantics are not yet defined.