Repository navigation
Releases: dolphlabs/slang
Release list
slang v0.2.5
Build speed and stack safety since v0.2.4:
- Development builds:
slangc --dev(orSLANG_DEV=1) compiles the generated C at -O0 without LTO, for edit-and-rerun loops such aszokor watch: a 21k-line service rebuilds in about 16 s instead of 73 s. Tasks start on a 32KB stack with a 16KB safepoint margin, and dev and release builds are cached apart. Not for deployment: the program uses about 1.6x the CPU. - Frame guards are remembered between builds (
~/.cache/slang/frames/, or$SLANG_CACHE/frames/), so a rebuild compiles the C once instead of two or three times (that 21k-line service: 225 s to 73 s). - Generated codecs are frame-guarded:
json.decode/json.encode,pg.rows_asandinspectof a wide struct (200+ fields) no longer overflow the task stack. - macOS: slangc builds with
-flto=thin. Xcode 15's linker dropped the frame report under full LTO, so no function was guarded there. - Linux: functions gcc reports under a clone's name (
.constprop,.isra,.part,.lto_priv) are guarded. - GC: result, opt and struct values with GC roots carry explicit, zeroed padding, so stale padding words are no longer scanned as possible pointers and cannot keep dead objects alive.
Install
From a tarball (relocatable: unpack anywhere and run in place). Pick
the one for your platform below; each was unpacked outside the source tree
and used to build and run a new project before this release was published.
tar -xzf slang-0.2.5-darwin-arm64.tar.gz
./slang-0.2.5-darwin-arm64/bin/slangc --version # slangc 0.2.5From source:
git clone https://github.com/dolphlabs/slang && cd slang
git checkout v0.2.5
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello && cd hello && slangc main.sl --runUpgrading a source install: run sudo make uninstall from the old
checkout first. make install overwrites the binary but never deletes
stale runtime files.
Requirements
slangc compiles to C, so every platform needs a C compiler (cc).
| you import | you need |
|---|---|
| anything | a C compiler |
net with TLS, crypto, httpc over https |
OpenSSL (macOS: brew install openssl; Debian/Ubuntu: apt install libssl-dev) |
sql |
SQLite (Debian/Ubuntu: apt install libsqlite3-dev; ships with macOS) |
compress, httpc |
zlib (Debian/Ubuntu: apt install zlib1g-dev; ships with macOS) |
The Linux tarballs are built on Ubuntu 24.04 and need glibc 2.39 or later;
on an older distribution, build from source.
SHA-256
509d074c15141bc05c139f79d8baf1c82ac6f0836dc4000530dd51b58917b37c slang-0.2.5-darwin-arm64.tar.gz
8f64f64e5735233af053160510903579a7c2e6350eca0d0d6ccfd40b20974990 slang-0.2.5-darwin-x86_64.tar.gz
2d3e9751ad15429c921e4ff3adf7acc203c4e105e6238e26635954c577fb9b7f slang-0.2.5-linux-aarch64.tar.gz
d7c3b8ecf63039e1c43aa12a3bce7505446a07074261007c6c47544d3dab1e8b slang-0.2.5-linux-x86_64.tar.gz
slang v0.2.4
Process, file watching, standard library, HTTP/2 and runtime updates since v0.2.3:
- Processes:
proc.spawnstarts a child without a shell (optionally in its own process group withproc.SPAWN_GROUP, or with stdin on /dev/null withproc.SPAWN_NULL_STDIN); an empty environment list inherits the parent's.proc.waitwaits for it with a deadline, parking the task on a pidfd (Linux) or kqueue (macOS) instead of blocking a worker, andproc.killsignals a child or its whole group. - File watching:
os.watch,os.watch_nextandos.watch_closereport batches of changed paths under a directory tree, with exclusions, through inotify (Linux) or FSEvents (macOS).os.mtime_nsgives nanosecond modification times. - Standard library:
sort: in-place sorting and binary search.crypto: Argon2id runs on dedicated KDF threads, andrsa_verify_sha256.
- HTTP/2: a multiplexed client, and responses with trailers. The client closes its transport only after its reader stops.
- Code generation: every opt and result is held by value; the current task is resolved once per function; loops with a numeric
+stay on the leaf path. Loop GC roots stay current across iterations, and achan_recvfill after a promoting wait is barriered. - Scheduler: idle workers spin and poll the network while spinning, and the parked-task registry is sharded off the GC lock.
- Networking: reactor waiters are woken only through their own registration, and
httpcapplies the request deadline to connecting. - Build: gcc's LTO pass no longer warns on every program built.
Install
From a tarball (relocatable: unpack anywhere and run in place). Pick
the one for your platform below; each was unpacked outside the source tree
and used to build and run a new project before this release was published.
tar -xzf slang-0.2.4-darwin-arm64.tar.gz
./slang-0.2.4-darwin-arm64/bin/slangc --version # slangc 0.2.4From source:
git clone https://github.com/dolphlabs/slang && cd slang
git checkout v0.2.4
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello && cd hello && slangc main.sl --runUpgrading a source install: run sudo make uninstall from the old
checkout first. make install overwrites the binary but never deletes
stale runtime files.
Requirements
slangc compiles to C, so every platform needs a C compiler (cc).
| you import | you need |
|---|---|
| anything | a C compiler |
net with TLS, crypto, httpc over https |
OpenSSL (macOS: brew install openssl; Debian/Ubuntu: apt install libssl-dev) |
sql |
SQLite (Debian/Ubuntu: apt install libsqlite3-dev; ships with macOS) |
compress, httpc |
zlib (Debian/Ubuntu: apt install zlib1g-dev; ships with macOS) |
The Linux tarballs are built on Ubuntu 24.04 and need glibc 2.39 or later;
on an older distribution, build from source.
SHA-256
e348e1d957bae6bc9d01dd7e7a7b719328f7b76c31b547fed1a6464b641337c9 slang-0.2.4-darwin-arm64.tar.gz
405cd4899f75549fc7536ba4e54089e72a78f72735bf10d7b7ec63244ed480fe slang-0.2.4-darwin-x86_64.tar.gz
7e4189bd223c915dfc792436355cc5a50b1dc98c08fb00b2f39566d446cd300b slang-0.2.4-linux-aarch64.tar.gz
7de17b03e16db023a5ef03319136a7b6a5e4899d0b668e1233925635655071f1 slang-0.2.4-linux-x86_64.tar.gz
slang v0.2.3
Language, runtime, networking and package updates since v0.2.2:
- Packages:
excludekeeps a package's non-runtime directories (examples, docs, benchmarks) out of the projects that depend on it, and importing an excluded directory is refused. - Networking:
link.tls_acceptruns a TLS handshake on a link, andlink.splitsplits a link into a reader and a writer. An idle worker now polls the network itself on Linux, so a ready connection runs without a thread handoff;SLANG_NO_WORKER_POLL=1turns this off. The reactor makes oneepoll_ctlcall per wait instead of two, and it no longer scans every waiter on every wakeup. - Scheduler: a
spawnfollowed straight byjoin_waitruns in place on the spawner, with a recovery point that turns a panic into the join's error. The worker pool is sized to a cgroup CPU quota. - Garbage collection: minor collections skip idle queued tasks as well as parked ones. A value sent through an old channel is no longer promoted on every send.
- HTTP:
Dateis sent on every response, and 204 and 304 responses carry no body or length.write_headframes a HEAD answer. Methods that are not tokens are refused. CR and LF in header fields are written as spaces. Extra header lines are written without copying. - PostgreSQL:
pg.rows_asdecodes typed rows directly, without intermediate JSON text, andtimez.Timevalues bind as times. - Standard library:
timez: calendar time, formats, time zones and cron.- JSON:
timez.Timeencodes as an RFC 3339 string. fs.realpathandfs.fstat.- Bounded Argon2id in
crypto. crypto.randreads the OS random source (getrandom, arc4random_buf) instead of OpenSSL under a global lock.
- Compiler fixes:
- escape analysis for values sent from a
selectarm; - liveness through local function values and method receivers;
- roots for spawn arguments;
- wrapping signed division by -1;
- extern functions under their own C names;
- generated lines longer than 16 KB.
- escape analysis for values sent from a
- Tooling:
slangc testloads pins from the package under test, and crash reports print the pc as an offset into the image.
Install
From a tarball (relocatable: unpack anywhere and run in place). Pick
the one for your platform below; each was unpacked outside the source tree
and used to build and run a new project before this release was published.
tar -xzf slang-0.2.3-darwin-arm64.tar.gz
./slang-0.2.3-darwin-arm64/bin/slangc --version # slangc 0.2.3From source:
git clone https://github.com/dolphlabs/slang && cd slang
git checkout v0.2.3
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello && cd hello && slangc main.sl --runUpgrading a source install: run sudo make uninstall from the old
checkout first. make install overwrites the binary but never deletes
stale runtime files.
Requirements
slangc compiles to C, so every platform needs a C compiler (cc).
| you import | you need |
|---|---|
| anything | a C compiler |
net with TLS, crypto, httpc over https |
OpenSSL (macOS: brew install openssl; Debian/Ubuntu: apt install libssl-dev) |
sql |
SQLite (Debian/Ubuntu: apt install libsqlite3-dev; ships with macOS) |
compress, httpc |
zlib (Debian/Ubuntu: apt install zlib1g-dev; ships with macOS) |
The Linux tarballs are built on Ubuntu 24.04 and need glibc 2.39 or later;
on an older distribution, build from source.
SHA-256
cad234a651435bdd9a52d119e0283131abd613a76d9b06552acc995cf34f10c7 slang-0.2.3-darwin-arm64.tar.gz
ed36209f7611f6d6ede5dcbed3e4c3015adb2adf5281f5fec498a464997bf112 slang-0.2.3-darwin-x86_64.tar.gz
efe9833374009960fb1daefa49d823c6982f1af186b826b655d31cbfbde6d140 slang-0.2.3-linux-aarch64.tar.gz
8ce2bbb537225f0562f83b544933e591a754a983f4f88e778e887e60b966e5d4 slang-0.2.3-linux-x86_64.tar.gz
slang v0.2.2
Runtime, database, and networking updates:
- Improve generational garbage collection with page-ordered sweeping, parallel sweep and marking, and less work for pointer-free containers and long-idle tasks. Fix tracing of value structs and opt/result payloads.
- Reduce PostgreSQL overhead with reusable query buffers, binary result decoding, FIFO pool waiters, and per-connection prepared statements.
- Bound Redis replies and improve pool waiter wakeups.
- Add bounded, deadline-aware DNS SRV/TXT lookup APIs for DNS seed-list clients such as MongoDB Atlas.
- Add little-endian binary64 conversion helpers and improve compiler diagnostics and fatal-signal reporting.
Install
From a tarball (relocatable: unpack anywhere and run in place). Pick
the one for your platform below; each was unpacked outside the source tree
and used to build and run a new project before this release was published.
tar -xzf slang-0.2.2-darwin-arm64.tar.gz
./slang-0.2.2-darwin-arm64/bin/slangc --version # slangc 0.2.2From source:
git clone https://github.com/dolphlabs/slang && cd slang
git checkout v0.2.2
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello && cd hello && slangc main.sl --runUpgrading a source install: run sudo make uninstall from the old
checkout first. make install overwrites the binary but never deletes
stale runtime files.
Requirements
slangc compiles to C, so every platform needs a C compiler (cc).
| you import | you need |
|---|---|
| anything | a C compiler |
net with TLS, crypto, httpc over https |
OpenSSL (macOS: brew install openssl; Debian/Ubuntu: apt install libssl-dev) |
sql |
SQLite (Debian/Ubuntu: apt install libsqlite3-dev; ships with macOS) |
compress, httpc |
zlib (Debian/Ubuntu: apt install zlib1g-dev; ships with macOS) |
The Linux tarballs are built on Ubuntu 24.04 and need glibc 2.39 or later;
on an older distribution, build from source.
SHA-256
fdb20eb7ab35aad071e244d61596dea204e180f290f24e94dca19feaaf7231f9 slang-0.2.2-darwin-arm64.tar.gz
62ee922f85288e72dc3dd49eede2433515342f01ab9777dd3815392d452e0e6d slang-0.2.2-darwin-x86_64.tar.gz
df97ac0d523d133b5ba59fecbf42813dd89cfa703834cd8f8590b72ddbe56fdc slang-0.2.2-linux-aarch64.tar.gz
b4525b08ff69cda6c817e69186359ecb6d4d353b223512d0a0a4b1d887f28d66 slang-0.2.2-linux-x86_64.tar.gz
slang v0.2.0
slang is a statically typed language built primarily for server-side and network programming, compiling to C. This release adds an HTTP client, compression and encoding, and fixes a runtime memory-safety bug.
Install
From source:
git clone https://github.com/dolphlabs/slang && cd slang
git checkout v0.2.0
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello && cd hello && slangc main.sl --runUpgrading: run sudo make uninstall from your old checkout first. make install overwrites the binary, but it copies runtime files over the old ones and never deletes stale ones.
From the tarball (macOS x86_64, relocatable, runs in place):
tar -xzf slang-0.2.0-darwin-x86_64.tar.gz
./slang-0.2.0-darwin-x86_64/bin/slangc --version # slangc 0.2.0sha256 52994a0d4980de3d6b09ee6cb94e9e684ac955ef4cabc2c4850dbe709408dc24
Requirements
The v0.1.0 notes said building "needs nothing but a C compiler". That is true for the core language, but not for every package:
| you import | you need |
|---|---|
| anything | a C compiler |
net with TLS, crypto, httpc over https |
OpenSSL headers and pkg-config on your PATH |
sql |
SQLite (-lsqlite3, ships with macOS) |
compress, httpc |
zlib (ships with macOS) |
On macOS, OpenSSL comes from Homebrew (brew install openssl pkg-config). If an https program fails with 'openssl/err.h' file not found, pkg-config isn't on your PATH. The tarball was verified in an otherwise empty environment with only Homebrew's bin on PATH.
What's new
Packages
encoding |
hex, base64, base64url, percent-encoding, query strings |
compress |
gzip, zlib and raw DEFLATE. Decompression requires an output limit: a 64 MB gzip bomb is refused at 3.9 MB RSS |
httpc |
HTTP/1.1 client over http and https. Certificates always verified, credentials dropped on cross-origin redirects, every server-controlled buffer bounded |
httpc.Client
- Connection pooling. Idle connections are probed before reuse (new
net.idle_alive). A dropped request is retried only if it's idempotent, never a POST. The pool key includes the CA bundle. - Transparent gzip/deflate decoding. Skipped if you set
Accept-Encodingyourself. - Cookie jar, off by default. A server's shared client would otherwise mix users' sessions. RFC 6265 with 6265bis
Securerules.
Language
pub fninsideimplnow parses. Before this, no method could be called from outside its own package, and the compiler's error told you to add thepubit then rejected.==and!=work between two bools.
The fix worth calling out
Stack relocation left compiler-hoisted stack addresses dangling. When a task's stack grows, it is copied and the old one unmapped. At -O2, clang can keep an address from the old stack in a register across that call. A spawned task doing TLS I/O inside a helper, which is the normal shape of a TLS server, crashed 3/3. Before guard-paged stacks (v0.1.0), the same writes went silently into freed heap memory. After the fix: 5/5 clean, and 3/3 crashes return with it disabled.
Known open
- ~5% SIGBUS under amplified preemption. Still open, and not related to the fix above: that workload never grows a stack.
- No public-suffix list for cookies.
Domain=co.ukfroma.example.co.ukis accepted. - A method can't share a name with a function in its package. This is why
httpcusesclient_get(c, …)rather thanc.get(…). - The stack-relocation regression test is compiler-sensitive, and says so. A clang upgrade could make it pass against a regression.
Only a macOS x86_64 binary is attached, because that is the only platform this release was built and verified on.
slang v0.1.0
First tagged release. A statically typed language built primarily for server-side and network programming, compiling to C.
Install
From source (any platform with a C compiler):
git clone https://github.com/dolphlabs/slang && cd slang
sudo make install # PREFIX=/usr/local, or ~/.local
slangc new hello
cd hello
slangc main.sl --run # hello from helloFrom the tarball (macOS x86_64) — relocatable, run it in place:
tar -xzf slang-0.1.0-darwin-x86_64.tar.gz
./slang-0.1.0-darwin-x86_64/bin/slangc --versionsha256 53027950307dc59b7eaf0450328218f5725481f737f7901b080e297eb7032969
Only a macOS x86_64 binary is attached, because that is the only platform this release was built and verified on. Building from source is the supported path everywhere else and needs nothing but a C compiler.
What's in it
| Concurrency | M:N green tasks, chan[T], select, mutex, join |
| Functions | function values — deliberately no closures, nothing is captured |
| Errors | opt / result / fault, with err_of binding the error so it can be logged |
| Packages | time net json proc fs os log crypto sql regex strings, plus http, http2, byteutil in source |
| Tooling | make install, slangc new, slangc get, --version |
| Docs | a site generated from the repository itself — www/ |
Two fixes worth calling out
Both were live bugs, each with measured before/after evidence rather than a claim:
Vector registers across preemption. The async trampoline saved only the low 128 bits of each vector register, so an interrupted AVX2 memcpy lost 16 bytes whenever something executed vzeroupper while the task was switched out. 10/30 runs corrupted before, 0/30 after.
Guard-paged task stacks. Stacks were plain malloc blocks, so overflow silently overwrote the next heap block — routinely another task's stack. With a PROT_NONE page under each, the first thing that faulted was OpenSSL reaching dlopen → dyld, which had been overflowing on every crypto and TLS program since those packages landed. RSS went down (49MB vs 54–58MB at 2000 tasks) because mapped pages fault in lazily.
Known open
Recorded rather than hidden — todo.md carries the detail:
- A ~5% SIGBUS under amplified preemption, not observed at stock settings. Three explanations have been tested and eliminated; the entry names them so nobody re-runs them, and suggests a next step.
- HTTP throughput declines from 16.3k rps at c=10 to 10.9k at c=500. Not characterised — the load generator may be the limit, and that is stated instead of guessed.
Verification
Full suite 165 passing, generated C warning-free. make install verified from a clean prefix under env -i with only the install prefix on PATH; the tarball verified unpacked at an unrelated path.
Built and maintained by Dolphlabs (Dolph Tech Limited).