slang

A Dolphlabs project

slang

A statically typed language built primarily for server-side and network programming — that is where it is aimed, not where it stops. It compiles to C, schedules M:N green threads, collects with a precise mark-sweep GC, and ships its standard library inside the compiler.

six 300ms requests, one connection
idle

slang

A statically typed language built primarily for server-side and network programming. Compiles to C.

Markdown version · llms.txt · api.json

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 programs

Compile a slang program:

./slangc examples/hello/main.sl     # produces ./main
./main                              # run it

Useful flags:

FlagEffect
-o <name>Choose the output binary name
--emit-cOnly write the generated C file (no compilation)
--keep-cKeep the generated C file after compiling
--runCompile, then immediately execute the result
getFetch 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.