slang
A statically typed language built primarily for server-side and network programming. Compiles to C.
Concurrency that is actually concurrent
spawn submits a green task onto striped, work-stealing
run queues. Channels, select and mutex park
the task, never the OS thread, so a blocked handler costs a
queue slot rather than one of the pool's threads.
Errors you cannot quietly drop
opt[T] for absent data, result[T, E] for
bad data, fault for a bad world. guard let x = r
else let e = err_of(r) binds the error so it can be logged
rather than thrown away.
C is the runtime, not a foreign country
slang emits C and shells out to cc. Calling a C library
is extern fn plus a linker flag — no bindings
generator, no FFI marshalling layer, no second build system.
Built for agents to read
Every page here has a Markdown twin at the same URL, the whole site
is one file at /llms-full.txt, and every package and
function is indexed in /api.json.
Quick start
make # build the slangc compiler
make test # compile & run the example programsCompile a slang program:
./slangc examples/hello/main.sl # produces ./main
./main # run itUseful flags:
| Flag | Effect |
|---|---|
-o <name> | Choose the output binary name |
--emit-c | Only write the generated C file (no compilation) |
--keep-c | Keep the generated C file after compiling |
--run | Compile, then immediately execute the result |
get | Fetch slang.project pins and write slang.lock |
Want to see everything at once instead of one feature at a time? See demo/ — a full server (dice game, guestbook wall, live dashboard) exercising every tier: http/link, net.tls_*, json, spawn/chan[T], proc graceful shutdown, local package imports, and C interop, with a real HTML/CSS/JS frontend. cd demo && ./run.sh.