April 24, 2026

Press ALT to start a flame war

Generalised plusequals

New 'alt' update trick sparks 'Lenses!' cheers and 'Still mutating?' jeers

TLDR: A new language pitch uses an “alt” keyword to update deeply nested data without changing the original. Commenters split: Haskell fans yell “lenses,” skeptics say it’s just sugar, and others point to q and Lil—raising a bigger question about novelty vs. practicality in language design.

A self-described “quarter-baked” language just dropped a flashy idea: an alt keyword that turns “x = x + 1” into “alt x + 1” and even lets you make deep changes—like aging a cat inside a nested list—without touching the originals. Throw in cute operators like “.=”, “]=”, and tilde-infused function calls (“alt l~push~5”), plus a promise that the compiler secretly uses fast, changeable data under the hood, and you’ve got a nerd soap opera. But the real show is in the comments.

The Haskell crowd rolled in waving lenses like glow sticks: “Seen it!” “Loved it!” “Do it right!” Others called it pure syntax sugar—sweet but not new. One skeptic poked the bear: if you’re “not mutating” the cat, aren’t you still changing the list holding it? Cue split-screen drama between Team Immutability and Team Practicality. The finance-nerd faction chimed in with q’s “amend”: powerful, but clunky—translation: been there, cursed that. Another commenter flexed with “Lil” language receipts, suggesting this vibe already exists elsewhere. Jokes flew about “Alt+F4 your bugs,” “cats aging gracefully,” and it being “lenses all the way down.” Verdict? The idea’s slick, but the internet is debating whether it’s a breakthrough or a remix of greatest hits—with memes.

Key Points

  • The article proposes an `alt` keyword that generalizes compound assignment to any infix operator (e.g., `alt x + 1` -> `x = x + 1`).
  • It introduces `]=` for immutable positional list updates and `.=` for immutable field updates, with Python analogs shown for each.
  • Examples demonstrate updating nested structures (e.g., `alt l[1][1].age.=9`) without mutating original values, with an explicit desugaring provided.
  • The language allows infixing plain binary functions via tildes (e.g., `alt l~push~5`) to apply operations immutably.
  • Design intent: treat data structures as immutable but allow compile-time substitution of mutable implementations when safe; references include Rust’s borrow checker, Swift’s value semantics, and a generalized Rust `?` operator.

Hottest takes

"Yeah this looks like lenses at first glance" — rokob
"Isn't that mutating l, though?" — hatthew
"q has the concept of amend, which is similar" — beaumayns
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.