; Basic variable declaration with and without default values. The type could be ; inferred, but can also be manually specified. let a: str let b: f64 let c:int = 20 ; No infix '=', instead we use `set` to bind values. set a = "hello" set b = 1.2 set c = (1 + 2 - 3) ; Struct definitions. struct vec { x: f64 y: f64 z: f64 } let v = vec : { x = 2.0 y = 3.0 } ; Default values are allowed, including const expressions. struct person { name: str = "joe" age: int = 18 * 2 } ; We can use the dot operator to access fields. let player_a: person set player_a.name = "alex" set player_a.age = 32 let player_b = player_a ; We can have anonymous struct fields. struct entity { pos: vec vel: vec attr: { id: int name: str } } ; Symbols followed by curly braces output struct literals. let particle = entity : { ; Two ways of initializing inner fields. pos = vec : { x = 1.0 y = 2.0 } attr = { id = 1 name = "particle" } ; Missing initialization fields default to zero. vel = vec : { y = -3.0 } } set particle = entity : {} ; ; We can have static arrays and have indexed access. ; let numbers: u32[0xff] ; set numbers[0] = 32 ; set numbers[1] = 42 ; ; Arrays are syntactic sugar for pointers (@). ; let ptr:@u32 = numbers ; set ptr[10] = 33 ; ; Strings hold a .mem and .size fields with the number of bytes it holds. ; let hello: str = "hello world" ; set c[1] = 'a' ; "hallo world"