The purported benefits of effect systems

Dev world splits: safety fans cheer while skeptics yell “overkill”

TLDR: A new explainer pitches effect systems—labels that show what a function can do outside pure logic—as a path to safer, easier testing. The comments split: fans say it finally enables sandboxing and clean tests, while skeptics see academic overkill, hinting at a big design fight for future languages.

Two language designers staged a nerdy duel over “effect systems,” which are like permission slips for your functions: they say up front if your code might talk to the internet, read your files, or print to the screen. The idea shows up in newer languages like Unison, Koka, and Flix, and promise safer, more testable code. The piece walks through how you can stack multiple “effects,” and even do type-level math to add or subtract them. But the real fireworks? In the comments, of course.

The top vibe: a split between “this fixes real-world pain” and “this is academic cosplay.” One loud cheer came from folks arguing that effects make the safe path the easy path, especially for sandboxing build scripts and writing tests. User curtisf summed it up as the “physics” of coding rewarding laziness—so make laziness safe. On the other side, skeptics rolled their eyes at scary-looking types, sniping that it’s just a fancy way to say “this might throw or do I/O,” and joking that “my boss won’t approve a rewrite in Koka.” Memes flew: “choose your fighter—wizard spells (handlers) vs permission slips (effects),” plus monad flashback jokes and “row math” screenshots. The crowd’s split, the takes are spicy, and the future of safer-by-default code has everyone hitting refresh.

Key Points

  • The article outlines two components of effect systems: effect handlers and type-and-effect systems.
  • Effect handlers enable custom control flow via continuations, with invocation semantics; OCaml supports them.
  • Type-and-effect systems annotate function types with permitted effects and support effect polymorphism.
  • Examples compare an effect-polymorphic List.map with Swift’s Sequence.map (throws) and AsyncSequence.map (async).
  • Effect rows can include multiple effects and support operations like union and subtraction, exemplified by Flix.

Hottest takes

“Effects make the right thing to do the easiest thing to do.” — curtisf
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.