Skip to content

slang v0.1.0

Choose a tag to compare

@Xlaez Xlaez released this 16 Sep 19:38
· 1203 commits to main since this release
0efe9f9

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 hello

From 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 --version

sha256 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).