Every variable in Hades carries an explicit type annotation written directly into its declaration. This static-style discipline means the interpreter can catch type mismatches at runtime before they silently corrupt your data — there are no implicit coercions between unrelated types.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ToberlerOhn/hades/llms.txt
Use this file to discover all available pages before exploring further.
Declaration syntax
The general form of a variable declaration is:nothing type — a nothing variable may be declared without a value because nothing is the value.
Semicolons are required after most statements. The two exceptions are: immediately after a closing
}, and at the very end of a block just before its own }.Built-in types
The following type keywords are recognised by the interpreter for variable declarations and type hints:nothing
Represents the absence of a value. All
nothing variables are falsy. The only type that does not require an initializer.bool
Boolean logic. Literal values are
TRUE and FALSE (uppercase). Any non-FALSE boolean is truthy.int
Whole numbers:
0, 1234, -7. Zero is falsy; any other integer is truthy.float
Floating-point numbers:
1234.5678. Zero (0.0) is falsy; all other floats are truthy.str
Single-quoted strings:
'hello'. An empty string '' is falsy; non-empty strings are truthy.list
Mutable, ordered sequences of any values enclosed in
[ ]. An empty list is falsy.The Hades language specification also describes a
record immutable sequence type (written as "elem0, elem1" and accessed with variable"index") and a struct type. These types are part of the planned language grammar but are not yet executed by the current interpreter. Declaring a variable with a record or struct type hint will produce a parse or runtime error in the current release.Truthiness reference
Hades uses truthiness rules to evaluate non-boolean values in conditions such asif guards and while tests.
| Type | Truthy | Falsy |
|---|---|---|
nothing | — | always |
bool | TRUE | FALSE |
int | any non-zero value | 0 |
float | any non-zero value | 0.0 |
str | any non-empty string | '' |
list | any non-empty list | [] |
Type checking
The interpreter enforces the declared type at the point of assignment. Declaring a variable with one type and providing a value of another raises a runtimeInterpreterError: