Lateralus v0.5.0 — Channels, Macros, Effects, Decorators & Comptime
v0.5.0 is the biggest Lateralus release yet. Five new feature pillars — each designed to work seamlessly with the pipeline operator.
Channels & Select
CSP-style channels for structured concurrency. Send and receive through typed channels, multiplex with select:
let (tx, rx) = channel::<SensorReading>(16)
spawn { sensor_loop(tx) |> await }
loop {
select {
reading from rx => process(reading),
closed => break,
}
}
Macros
Declarative macros for code generation. Define patterns, expand at compile time:
macro define_builder($name:ident, $($field:ident : $type:ty),*) {
struct $name { $($field: Option<$type>,)* }
impl $name {
fn new() -> $name { $name { $($field: None,)* } }
$(fn $field(self, val: $type) -> $name {
$name { $field: Some(val), ..self }
})*
}
}
Effect system
Algebraic effects let you declare side effects in function signatures and handle them at call sites:
effect Log {
fn log(level: String, msg: String) -> ()
}
fn process(items: [String]) -> [String] with Log {
for item in items {
perform Log::log("info", "Processing: {item}")
}
items |> map(to_uppercase)
}
Decorators
Annotations for cross-cutting concerns — timing, memoization, retry logic, validation:
@timed
@retry(max_attempts: 3, backoff: "exponential")
async fn fetch(url: String) -> Result<String, Error> {
http::get(url) |> await
}
Compile-time evaluation
const fn and comptime blocks evaluate at compile time with zero runtime cost:
const fn factorial(n: Int) -> Int {
match n { 0 | 1 => 1, n => n * factorial(n - 1) }
}
const FACT_20: Int = factorial(20) // Computed at compile time
Upgrade
All features are backward-compatible. Update with pip install --upgrade lateralus-lang and try them in the playground.
Migration guide
Upgrading from v0.4.x to v0.5.0 requires a few changes. Here's a complete migration checklist:
// 1. Error handling: ? operator replaces try/catch
// Before (v0.4.x):
let result = try { parse_json(input) }
catch (e) { default_value }
// After (v0.5.0):
let result = parse_json(input) |?> default_value
// Or with explicit handling:
let result = match parse_json(input) {
Ok(v) => v,
Err(e) => { log_error(e); default_value },
}
// 2. Async: spawn() replaced with async/await
// Before:
let handle = spawn(|| fetch_url(url))
let result = handle.join()
// After:
let result = async fetch_url(url) |> await
// 3. Collections: .len property replaced with .len() method
// Before: my_list.len
// After: my_list.len()
Benchmark improvements
v0.5.0 is significantly faster than v0.4.x thanks to pipeline fusion and improved codegen:
- Pipeline-heavy code — 2.1x faster (pipeline fusion eliminates intermediate allocations)
- JSON parsing — 1.8x faster (SIMD-accelerated string scanning in the C99 output)
- Compilation speed — 1.4x faster (incremental compilation caches type-checked modules)
- Binary size — 15% smaller (dead code elimination removes unused standard library functions)
- Startup time — 0.8ms (no runtime initialization, no GC, no JIT warmup)
New standard library additions
v0.5.0 ships 6 new standard library modules:
// std::http — HTTP client and server
let response = http::get("https://api.example.com/data")
|> await
|> json()
// std::toml — TOML parser for config files
let config = read_file("config.toml") |> toml::parse()
// std::regex — Regular expression engine
let emails = text |> regex::find_all(r"[\w.-]+@[\w.-]+\.\w+")
// std::arg — Command-line argument parser
let args = arg::parser()
|> arg::flag("verbose", short: 'v', help: "Enable verbose output")
|> arg::option("output", short: 'o', default: "out.txt")
|> arg::parse()
// std::log — Structured logging
log::info("Processing started", count: items.len(), mode: "batch")
// std::test — Enhanced test framework
test "pipeline produces correct results" {
let input = [1, 2, 3, 4, 5]
let result = input |> filter(|x| x > 2) |> map(|x| x * 10)
assert_eq(result, [30, 40, 50])
}
What's next: the v0.6.0 roadmap
v0.5.0 is a stable foundation. Here's what's planned for v0.6.0 (tentatively Q3 2026):
- Generics — the most requested feature. Type parameters for functions and structs, with trait bounds for constraining type arguments.
- REPL improvements — multi-line editing, tab completion for struct fields, and inline documentation display.
- LSP server — the VS Code extension currently uses regex-based highlighting. v0.6.0 will ship a Language Server Protocol implementation for real-time type information, go-to-definition, and rename refactoring.
- Package registry —
lpm publishwill go live. The registry infrastructure is already built; we're finalizing the moderation and security review process. - WebAssembly target — compile Lateralus to WASM for browser deployment. The C99 backend can target Emscripten, but a native WASM backend will produce smaller, faster output.