Getting started
q64 is a stream-first language that compiles to WebAssembly. This guide takes you from an empty directory to a running program.
Install the toolchain
Clone the repository and run the setup script, which vendors a pinned Zig
toolchain and the supporting tools, then builds the q64 binary:
git clone https://github.com/q64-lang/q64cd q64./init.shexport PATH="$PWD/vendor/zig:$PATH"( cd q64 && zig build ) # produces q64/zig-out/bin/q64Your first qube
A q64 source file uses the .q extension. The module header is a //! doc
comment; fn main is the entry point.
//! hello — minimal q64 example.
fn main { env.out("Hello, q64.")}Save it as hello.q, then compile it to WebAssembly:
q64 emit hello.q /tmp/hello.wasmInspecting the language
The compiler can describe itself. q64 doc --json emits the full language
index — keywords, builtin types, and diagnostics — the same data this site’s
reference is generated from:
q64 doc --json | jq '.language.keywords[0]'When you hit an error, q64 explain <code> prints what it means (and links to
its page under Diagnostics):
q64 explain LEX010