Repository navigation
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