Joa is dynamically typed. Every value carries its type at runtime.
| Type | Description | Example |
|---|---|---|
Integer |
64-bit signed integer | 42, -7, 0 |
Float |
64-bit floating point | 3.14, -0.5 |
String |
UTF-8 text | "hello" |
Bool |
Boolean | true, false |
Null |
Absence of a value | null |
List |
Ordered, heterogeneous collection | [1, "a", true] |
Map |
Key-value dictionary | {name: "Alice", age: 30} |
IP |
IPv4 address (native type) | 192.168.1.1 |
Subnet |
IPv4 CIDR block (native type) | 192.168.1.0/24 |
Agent |
Agent configuration with simulated methods | AI agents |
Function |
User-defined function (supports closures) | Functions |
The null Literal
null is a first-class value and keyword. It represents the deliberate absence of a value. Functions that do not return a value implicitly return null.
let empty = null
print(type(null)) // Null
if not empty {
print("no value") // executes — null is falsy
}
Type Inspection
print(type(42)) // Integer
print(type("hello")) // String
print(type(192.168.1.1)) // IP
print(type(10.0.0.0/8)) // Subnet
print(type(null)) // Null
print(type({})) // Map
Type Conversion
let n = int("42") // String → Integer: 42
let f = float(7) // Integer → Float: 7.0
let s = str(3.14) // any → String: "3.14"