Repository navigation
First release.
- Compiler
rokc(AOT via MLIR / LLVM 22, REPL, Jupyter kernel, language server,fmt,lint,doc,test,
bench,bindgen), package / build front-endrok(rok.rokon/rok.lock, path / git dependencies, stones,
environments, toolchains), runtimelibrokr.a, standard librarycore/std/bare. - Install: rustup-style layout (
~/.rok/binproxies,~/.rok/toolchains/<version>-<triple>/),install.sh/
install.ps1, androk-<version>-<triple>.tar.gz/.tar.xz(Windows.zip) archives built bydist.sh
(Linux:dist-linux.sh, in a Debian 11 container; they need glibc 2.34 or later). rok/rokc/rokls --versionprint the version, commit, and date.- License
MIT OR Apache-2.0.
Language
- Using a value after it was handed off (
Mutex::new,send,task::spawn,Handoff::new, through calls)
is a compile error; the check follows conditions, call outcomes, a collection's elements, copies and aliased
arguments, and each error says what to write instead. - A hand-off gives the receiver its own copy of every collection the value reaches (a list and its views keep
one buffer; values built at compile time are not copied), so a route the check misses cannot race. A
coroutine future gets a frame of its own; one that has started cannot be handed over. - A lock guard and its value stay inside their
usingblock: returning, storing, yielding or capturing them
(closures and coroutines included) is an error. Frozen<T>shares a value read-only between threads withoutunsafe;getgives each reader a copy and
keepsSyncparts shared.parruns items that reach one collection or future one at a time, with a warning naming the call.Weak<T>is notSend;any Trcrosses threads only when its bound hasSend + Sync.- Every
awaitof aTaskthat was handed on gets its own copy of the result. - Duplicate items point at both definitions; a tuple or unit struct's constructor shares the value namespace
with functions, consts and statics. A nameduseand a local item of the same name are an error; a glob
import gives way. - Names from another module need a
use; "cannot find" errors suggest theuseto add or the missingpub. - Generic argument counts are checked; a bare generic type says it needs arguments.
- Generic unions; impls on generic type aliases; an alias's
whereis checked in declaration types. - Block-local items (
struct,enum,impl,use,constin a block), including module globuse. - Statics and consts of
fntype are callable.Syncrules for statics,RwLockand[ref]cells. #[cold]keeps a function out of line.- A
try!panic shows the error and where it was raised.
Tools
- Scripts:
rok <file>, shebang lines, dependencies from the file's//! rokonblock (rok add <lib> <file>),
mod helper;across script files;importgets an error namingmod/use. - Packages with both
src/lib.rokandsrc/main.rok;rok install <stone>installs executables, keeps one
installed at the same version and rebuilds with--force;rok install <lib>serves the REPL and Jupyter. - The package name
rokis reserved for the standard library; names code can't write as a path (pkg,
sup, keywords) are refused with a suggestion. Everyrok newtemplate is tested end to end. - Temporary files and directories are removed on exit, error and panic; leftovers of killed processes are swept,
and a REPL host ends with itsrokc. - Build profiles: debug info by default; release folds identical code and strips.
- Lints in every compiling command; hints for habits from other languages.
Platforms
- Verified natively: macOS arm64 (macOS 26 and 27 SDKs), Linux x86_64 and aarch64 (Ubuntu 26.04), Windows
x86_64 (Windows 11). Windows arm64 links but has not been run. - macOS 27: rokc's linker reads the new SDK's stubs (
arm64e.x1). - Windows: libclang (
rokc bindgen), a PGO profile for the clang-cl LLVM build,dist.shand
install.ps1 -NoModifyPath; CI builds the prefix with clang-cl, runsbindgen, and a nightly job installs
the distribution and builds a package with it. riscv64gc-unknown-linux-gnu, verified on a riscv64 kernel.
Performance
- Bounds checks of counted loops over lists move in front of the loop; short loops and loop nests run without
safepoint polls; a fixed-index element stays in a register. - Calls between rok functions pass the thread block as an argument; the GC frame links only on paths that reach
a safepoint; locals that only a loop's poll sees are rooted on its yield path only. task::spawnof a future made at the call, or kept in a local nothing else names, skips the hand-off.- PGO profiles retrained for macOS 27 and Linux: rokc's own
-O2builds are 5-10% faster than without. - rok / C instructions on the bench suite: nbody 1.46x, fannkuch 1.64x, spectral_norm 1.11x, throw_parse 1.85x;
json_tokenizer 0.69x, word_count 0.89x, binary_trees 0.55x.