Variables & Constants
let x = 42— mutable variable, inferred type
const PI = 3.14— immutable constant
let name: Text = "Nova"— explicit type annotation
let x: Int = 10, y = 20— multi declaration
Types
Int, Float, Bool, Text, Byte— primitives
List<T>, Map<K,V>, Set<T>— collections
Option<T>, Result<T,E>— safe error types (Some/None, Ok/Err)
Tensor<T>, Model— AI/ML built-ins
Tuple(Int, Text)— tuple type
Fn(Int, Int) -> Int— function type
Functions
fn add(a: Int, b: Int) -> Int { return a + b }
fn greet(name = "World") -> Text { ... }— default params
async fn fetch(url: Text) -> Result<Text, Error> { ... }
pure fn square(x: Int) -> Int { x * x }— side-effect free
let double = |x| x * 2— lambda
Control Flow
if / else if / else
for item in collection { ... }
for i in 0..10 { ... }— range loop
while condition { ... }
loop { ... break }— infinite loop with break
match value { pattern => expr, _ => default }
Classes & Traits
class Dog { name: Text; fn bark() { ... } }
class Puppy extends Dog { ... }— inheritance
trait Greetable { fn greet() -> Text }— interface
impl Greetable for Dog { ... }— trait impl
Operators & Pipelines
x |> fn1 |> fn2— pipe operator
a ?? b— null coalescing
obj?.field— optional chaining
a ** b— exponentiation
a .. b, a ..= b— ranges (exclusive / inclusive)
not, and, or— human-readable logical ops
AI Builtins
let t = tensor([1,2,3], shape=[3])
let t2 = t.reshape([1,3]).matmul(w)
let m = model.load("path/to/weights")
let result = await m.predict(input)
let loss = mse(pred, target)
Concurrency
let handle = spawn task()— lightweight goroutine-like
let result = await handle
let ch = channel<Int>()— CSP channel
ch.send(42) / ch.recv()
parallel for item in list { ... }— parallel loop
OS & System
os.read("file.txt")— file I/O
os.write("out.txt", data)
os.env("PATH")— environment variable
os.run("ls -la")— shell command
os.args— command-line arguments
net.get("https://api.example.com")— HTTP