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