Rubysyn: Clarifying Ruby's Syntax and Semantics

A 'sugar‑free' Ruby explainer drops — commenters say keep the sprinkles

TLDR: Rubysyn offers a sugar‑free, Lisp‑style way to write Ruby to make tricky rules easier to see. The crowd mostly pushes back: jokesters want a postcard cheat‑sheet, traditionalists insist on keeping Ruby’s “sweetness,” while a smaller group praises the clarity for teaching and tools.

Ruby just went on a diet—at least in theory. A new work‑in‑progress called Rubysyn proposes a Lisp‑style (think lots of parentheses) way to write Ruby so its rules are crystal clear. It keeps Ruby’s behavior but strips out “syntax sugar,” the cute shortcuts many devs love. The author dives into how arrays with a star work, why nil quietly vanishes in lists, and other quirks—then “desugars” it all so anyone can see what’s really happening.

The comments? Spicy and hilarious. One reader deadpans, “I prefer the postcard ;-),” linking to a cheeky cheat‑sheet summary on a single card (this one). Another fires off the line seen ’round the thread: “Lisp? Then I would use Lisp…” and doubles down with, “Ruby has syntax sugar, no need to remove the funny parts.” Translation: don’t take our sprinkles. Memes fly about a “Ruby sugar detox,” fears of a parentheses avalanche, and jokes that this is turning cake into kale.

Still, a quieter crew appreciates the clarity, applauding the deep dive into star‑expansion and other edge cases—handy for teaching, tooling, and avoiding gotchas. But the vibe today is clear: team charm vs. team clarity, with Ruby romantics guarding the sugar bowl like it’s holy ground.

Key Points

  • Rubysyn proposes a Lisp-based, sugar-free syntax for Ruby that preserves Ruby semantics.
  • The article documents full array literal syntax, emphasizing the constructing array splat [1, 2, *foo, 3].
  • Constructing array splat semantics: expand arrays, use to_a when available (must return Array), otherwise append the value; nil.to_a => []; hashes expand to key–value pair arrays.
  • A Ruby function (array_splat) is provided as a desugaring model; no standard Ruby function exactly matches its semantics.
  • The piece outlines Rubysyn forms for variables, control flow, blocks/lambdas, method calls, classes/modules, and notes [] is sugar for Array#[].

Hottest takes

"I prefer the postcard ;-)" — Smalltalker-80
"Lisp? Then I would use Lisp..." — SeriousM
"Ruby has syntax sugar, no need to remove the funny parts." — SeriousM
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.