Skip to content

Introduction

Sysl is a systems programming language. It’s the language the SLIX microkernel is written in, the language the TRISC teaching emulator is bootstrapped from, and the language a growing standard library — regex engines, crypto, containers, I/O — is built on.

It has three backends: a tree-walk interpreter, a codegen to the 16-bit TRISC teaching ISA, and an LLVM codegen for native performance. The same source compiles on all three.

Know where your bytes live. Every type has a known size and a known allocation site. var v = Point(1, 2) is on the stack. val r = new Point(1, 2) is on the heap, refcounted. var p: *Point = &v is a raw, unmanaged pointer. These are three different types with three different rules, and the compiler enforces the difference.

No implicit integer promotion. u8 + u8 produces a u8 that wraps. If you want u8 + u8 → int, you widen by hand: int(a) + int(b). This matches Go, Rust, and Swift. C’s integer conversion rules are a source of bugs; Sysl opts out.

The type system carries your intent. type Age = int within 0..150 is a real subtype with runtime bounds checking. *T not null is a real subtype that traps at produce sites. #pure is a static check that a function performs no observable side effects. Assertions and invariants are in the source, not in comments.

One language, many scales. Non-escaping closures capture on the caller’s stack — no allocator needed. volatile on a struct field stops the compiler from touching a memory-mapped register. Inline asm blocks let you drop to the metal when you have to. The same language writes boot code, a scheduler, a shell, and a regex engine.

  • Not a garbage collector. Refs use a header-based refcount. When the count hits zero, the deinit runs, children are decremented, and the block is freed. Cycles leak unless you break them with a raw pointer — intentional, to keep the runtime predictable.

  • Not async-first. There are no futures or coroutines in the language today. Concurrency is whatever your platform provides (kernel threads on SLIX, pthreads under POSIX, bare interrupts on TRISC).

  • Not a successor to C++. The standard library is small and opinionated. There is no exception machinery; failures are Result[T, E] or a trap. Operator overloading is limited to traits the compiler recognises (Add, Ord, …) — no custom operators, no ADL.

FeatureSyslCGoRust
Value / ref / raw pointer✅ all three, first-classraw pointers onlyimplicitT, Rc<T>, *T
Ref countingbuilt-in &Tby handGCRc<T> / Arc<T>
Tagged unions + pattern matchnono
Design by contractrequire / ensure / invariantnonovia macros
Range-constrained typesint within 0..150nonono
Literate programming.lsyslnonono
No implicit int promotion😬
LLVM targetvia gccgo
Teaching-ISA target✅ (TRISC)kind ofnono