Limitations
What slang does not do, stated plainly.
Known limitations
- Block scoping: a
letinsideif/else/while/foris not visible afterwards. Loop bindings (for i in ...) are scoped to the loop. Redeclaring a name in the same scope is an error; inner blocks may shadow.guard letstill binds for the rest of its enclosing block. - Strings are immutable; concatenation allocates. The collector reclaims unreachable strings automatically.
- Package globals require constant-literal initializers.
- Implicit returns only apply to the last statement of a function body;
ifand{}blocks are statements, not expressions yet. - No closures. Functions are values (
fn(int) -> int), but they capture nothing — a function value always names a top-level function, never an environment.break/continuework inside loops. - Package-level lists are not supported yet (scalars and bytes are).
- Map keys are limited to integers,
str, andbool. - No data-race protection:
spawngives you real concurrency and per-task failure isolation, not an ownership/borrow checker. Mutating a shared struct/list/map from more than one task is on you, same as Go or Java —mutexis available for it, but nothing makes you reach for one. selecthas no timeout arm and no way to disable an arm. A closed channel's recv arm is ready forever (see Concurrency above), and there is no nil channel to switch it off with; for a deadline, feed a channel from a spawned timer task.mutexhas no scope guard: without closures ordefer, an earlyreturnbetweenmutex_lockandmutex_unlockleaks the lock. Mutexes are also not recursive (locking one twice from the same task is a checked error, not a hang).- TLS: no session resumption tuning. Handshake and send/recv park;
getaddrinfointls_dialparks the task while a dedicated thread resolves. mTLS (tls_ctx_require_client/tls_ctx_use_cert) and SNI extra certs (tls_ctx_add_sni) are supported. - JSON: no dynamic/unknown-shape decoding (every decode target is a concrete slang type known at compile time — see the
jsonsection above), and JSON object keys map to struct field names verbatim (no camelCase/snake_case conversion).bytesfields are base64 strings (RFC 4648). proc: onlySIGTERM/SIGINTare handled (there's no general signal-registration API); a signal that arrives in the narrow window beforemain()installs the handler gets the OS's default disposition (immediate termination) rather than graceful handling.proc.wait_idle()parks untilproc.active_tasks()is zero.