Releasing v0.1.8 — Literal Coercion, Indirect Enums, and LLVM 22

· 2 min read
v0.1.8

I didn’t plan a theme for this release, but most of the changes are about the type system doing more work so the programmer does less.

Numeric literal type coercion with range validation. Integer literals now coerce to narrower types when the value fits. let x: u8 = 200 works, let y: u8 = 300 is a compile error. The compiler checks the range at compile time rather than silently truncating at runtime, which is the kind of thing that seems obvious until you realize most languages don’t do it.

indirect enum for recursive data types. You can now write indirect enum List { Cons(i32, List), Nil } — the compiler boxes the recursive variant automatically. Without indirect, a recursive enum would be infinitely sized and the compiler would reject it. This was the missing piece for trees, linked lists, and any AST-like structure.

Replaced gen fn state machine with LLVM coroutines. Generators were previously lowered to a hand-rolled state machine in MLIRGen. Now they use LLVM’s coroutine intrinsics (LLVM’s built-in mechanism for suspendable functions)@llvm.coro.begin, @llvm.coro.suspend, the whole family. The generated code is smaller and LLVM can optimize across yield points, which the state machine approach couldn’t.

Higher-order Vec methods. Vec.map(), Vec.filter(), Vec.fold() — these existed in the stdlib as standalone functions, now they’re methods on Vec. Also HashMap.keys, String.lines, String predicates like is_empty and starts_with, and Vec.join.

Named supervisor child access. Supervisor children are now accessible via field syntax — supervisor.worker_name instead of indexing by position. Reads better and breaks less when you reorder children.

await actorRef for void actors. You can now await an actor that doesn’t return a value, blocking until it terminates. Previously you had to poll or ignore it.

LLVM/MLIR upgrade from 21 to 22. The auto-detection logic now prioritizes LLVM 22 when both versions are installed.

Part 22 covers literal coercion and indirect enums in depth.