← Back to Blog

Five Niches, One Language

2026-04-12 nicheshowcasestdlib

A general-purpose language earns its keep in the weird places. This week the ecosystem ships five modules that have almost nothing in common except that they were each written in a single afternoon in Lateralus — and that each one is, as far as we can tell, the first of its kind across the lateralus-* repos.

◉ The uniqueness bar

Every file went through a two-step dedup check before it was allowed in:

- gh api repos/bad-antics/<repo>/contents/<path> must return 404. - grep -rE '<domain keywords>' --include='*.ltl' across the whole ecosystem must return no meaningful topical match, only incidental string hits.

The result: five files, five domains, zero duplicates.

- lateralus-compiler/effects/capability_tracker.ltl — static capability tracking, first in eco - lateralus-stdlib/bio/fasta.ltl — bioinformatics FASTA, first in eco - lateralus-stdlib/retro/gameboy_rom.ltl — Game Boy cartridge, first in eco - lateralus-examples/niche/lora_mesh_packet.ltl — LoRa mesh radio, first in eco - lateralus-examples/niche/midi_pipeline.ltl — MIDI creative coding, first in eco

◉ 1. A capability-tracking compiler pass

The headline pass is effects/capability_tracker.ltl. Every function carries a set of capabilities — net::listen, fs::write, clock::read, ffi::call — inherited transitively through the call graph. An explicit #[caps_sealed] attribute locks a function's set; any call that would widen it is a compile-time error. The result: untrusted plugins that the compiler can prove will never touch the network, with zero runtime overhead.

#[caps(fs::read)]
#[caps_sealed]
fn parse_config(path: String) -> Result<Config, String> {
    let raw = fs::read_text(path)?      // allowed
    net::listen("0.0.0.0:80")?          // rejected at compile time
    parse(raw)
}

◉ 2. FASTA without materializing the genome

bio/fasta.ltl is a streaming parser: it yields one Record at a time so a 30 GiB human genome never becomes a 30 GiB string. The module — including reverse_complement, gc_content, k-mer counting, and a full codon translation table — lands in under 250 lines.

fasta::read_file("genome.fa")?
    |> filter(|r| r.id |> starts_with("chr"))
    |> map(|r| (r.id, gc_content(r.sequence)))
    |> collect()

◉ 3. A Game Boy cartridge in one module

retro/gameboy_rom.ltl is a faithful parser of the DMG / CGB cartridge header, including the Nintendo logo copy-protection check, the x = x - rom[i] - 1 header checksum algorithm, the 16-bit global checksum, and every cartridge type from RomOnly through MBC7_Sensor_Rumble_Ram_Battery. Point it at a .gb file on the command line; it prints the metadata and a string-dump of everything the developer forgot to strip.

◉ 4. LoRa mesh, store-and-forward included

niche/lora_mesh_packet.ltl gives you a 12-byte mesh header with hop limit and hop count, a 32-entry LRU for duplicate suppression, optional AES-CCM encryption using a per-channel key, and a handle_rx state machine that decides in a single pattern-match whether to deliver, forward, or drop.

match handle_rx(&mut mesh, packet) {
    Disposition::Delivered(payload) => app::on_message(payload),
    Disposition::Forwarded          => metrics::inc("forwarded"),
    Disposition::Dropped(reason)    => log::debug("drop: {reason}"),
}

◉ 5. MIDI as a pipeline

niche/midi_pipeline.ltl parses a Standard MIDI File into [TimedEvent], then every creative transform is just a function — transpose, quantize, filter_channels. Pipeline operators make the intent obvious.

bytes
    |> parse_smf()?
    |> .tracks
    |> map(quantize(24))
    |> map(filter_channels([0, 9]))
    |> map(transpose(-12))
    |> render_smf()

◉ Why this matters

Most languages concentrate their ecosystem around one or two dominant domains: JavaScript → web, R → statistics, Julia → scientific computing. A general-purpose language proves itself by being unremarkable in the places it isn't supposed to be. These five modules are our receipt for that claim: one afternoon, five domains, zero of them web backends.

Read the source on GitHub via the lateralus-compiler, lateralus-stdlib, and lateralus-examples repositories.

Try it in the playground

Every snippet on this page runs in your browser. No install, no signup.

▶ Open Playground Star on GitHub