Skip to content

slang v0.2.3

Choose a tag to compare

@github-actions github-actions released this 15 Oct 22:29
· 159 commits to main since this release
15ce877

Language, runtime, networking and package updates since v0.2.2:

  • Packages: exclude keeps 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_accept runs a TLS handshake on a link, and link.split splits 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=1 turns this off. The reactor makes one epoll_ctl call per wait instead of two, and it no longer scans every waiter on every wakeup.
  • Scheduler: a spawn followed straight by join_wait runs 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: Date is sent on every response, and 204 and 304 responses carry no body or length. write_head frames 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_as decodes typed rows directly, without intermediate JSON text, and timez.Time values bind as times.
  • Standard library:
    • timez: calendar time, formats, time zones and cron.
    • JSON: timez.Time encodes as an RFC 3339 string.
    • fs.realpath and fs.fstat.
    • Bounded Argon2id in crypto.
    • crypto.rand reads the OS random source (getrandom, arc4random_buf) instead of OpenSSL under a global lock.
  • Compiler fixes:
    • escape analysis for values sent from a select arm;
    • 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.
  • Tooling: slangc test loads 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.3

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

Upgrading 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