Goroutine-Style Concurrency
Lightweight Tasks with work-stealing scheduler. Write async code that looks synchronous. Start thousands of concurrent tasks without OS thread overhead.
Compile-time type safety. Lightweight concurrency. Familiar syntax.
import io from "std:io";
// Async functions create lightweight Tasks
async function fetchUser(id: number): Task<string> {
return `User ${id}`;
}
function main(): void {
// Tasks start immediately - no explicit spawn
const tasks = [fetchUser(1), fetchUser(2), fetchUser(3)];
// Await array of tasks - returns array of results
const users = await tasks;
for (const user of users) {
io.writeln(user);
}
}Early Project
Raya is in active development. APIs may change. Not ready for production. But if you're curious about:
...then Raya might be worth watching.
| What | How |
|---|---|
| Explicit over implicit | Discriminated unions, type annotations required |
| Safety over convenience | No escape hatches, sound type system |
| Performance through types | Static types → typed opcodes → unboxed operations |
| Familiar syntax | TypeScript-compatible where it makes sense |
| Predictable semantics | No prototype chains, no coercion magic |
// Synchronous I/O becomes concurrent with async prefix
import fs from "std:fs";
const task1 = async fs.readTextFile("a.txt"); // Starts immediately
const task2 = async fs.readTextFile("b.txt"); // Runs in parallel
const a = await task1; // Suspend until ready
const b = await task2;// Discriminated unions with exhaustiveness checking
type State =
| { kind: "loading" }
| { kind: "success"; data: string }
| { kind: "error"; message: string };
function handle(state: State): void {
if (state.kind == "loading") {
logger.info("Loading...");
} else if (state.kind == "success") {
logger.info(state.data); // Compiler knows 'data' exists
} else {
logger.error(state.message); // Compiler knows 'message' exists
}
}any type - all values have known typesAll I/O is synchronous. Concurrency achieved with Tasks at call site.
curl -fsSL https://raya.land/install.sh | shBuild from source:
git clone https://github.com/rizqme/raya.git
cd raya
cargo build --release -p raya-cliWhat works:
What's coming:
Tests: 4,121+ tests passing (engine, runtime, stdlib, CLI, PM)
MIT OR Apache-2.0