Skip to content

Language Reference

Key concepts

  • Variables: make (immutable), make shift (mutable)
  • Functions: craft name(args) -> return_type { ... }
  • Control: check/otherwise, loopwhile, foreach, for
  • Types: i32, u64, str, link T, [T; N]
  • Tuple destructuring: make (a, b) = fn_returns_tuple();
  • Cast: expr as type (e.g. x as usize)
  • String interpolation: `Hello, ${name}!` — backtick strings with ${expr}
  • C FFI: extern craft name(args) -> ret;

Example

craft add(a: i32, b: i32) -> i32 {
    send a + b;
}

craft main() -> void {
    make x: i32 = add(1, 2);
    print(`Result: ${x}`);
    send;
}

Standard Library

  • fsopen_file, close, read_all, exists, write_all
  • osrun, getenv, cwd
  • mathabs_i32, sqrt_f64, add_checked_i32, etc.
  • strtrim, concat
  • timenow
  • randnext, seed
  • arenaalloc, dealloc
  • simdloadu_ps, storeu_ps, add_ps, mul_ps