Types
| Type | Notes |
|---|---|
int | i64, default integer |
bool | true / false |
string | owning; slices copy |
f64 | IEEE754 |
i32 / u32 / u8 / byte | distinct narrow ints; no implicit widen; wrap |
[]T | dynamic array |
[N]T | fixed; no push |
struct / enum | product and tagged union |
&T / $&T | shared / exclusive borrow |
*raw T | raw pointer; dereferencing requires unsafe block; supports pointer arithmetic and address casts; bypasses borrow checker |
any / temp | dynamic box; is / as |
map[K]V | key int or string; value copy or string |
chan T | ownership moves through the channel |
Fields are package-visible by default; cross-module fields need pub or a pub: block. := infers locals; parameters and results are explicit. Low-level structs support @repr("C", align: N) precise alignment and @repr("C", packed) zero-padding layout.