News for hackers. Stuff that matters.
Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by SeriousM on Sunday April 05, 2026 @04:41AM (#47647389)
> This is an experiment in clarifying some aspects of Ruby syntax and semantics. For that we're going to introduce an alternative Lisp-based syntax for Ruby, preserving Ruby semantics.

Lisp? Then I would use Lisp...

> The goal is to define a comprehensive, trivially-parsable and sugar-free syntax.

Ruby has syntax sugar, no need to remove the funny parts.

Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by petalmind on Sunday April 05, 2026 @06:19AM (#47647914)
> Lisp? Then I would use Lisp...

Lisp has completely different runtime semantics. Even the lexical scope in Ruby is extremely peculiar. One of the hard parts of writing this document was to remove the intuitive influence of Lisp because it just doesn't make sense for Ruby.

Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by petalmind on Sunday April 05, 2026 @06:23AM (#47647953)
> Ruby has syntax sugar, no need to remove the funny parts.

This is just an intermediate representation, it's not meant to be used directly (even though you can do that, of course).

Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by lifthrasiir on Sunday April 05, 2026 @09:33AM (#47649285)
S-expression is a standard representation for syntax-free semantics. For example, PLT Redex [1] is a DSL for programming language semantics and built on top of Racket which uses S-expressions.

[1] https://redex.racket-lang.org/

Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by petalmind on Sunday April 05, 2026 @09:40AM (#47649345)
Even Ruby `parser` gem uses S-expressions in their documentation: https://github.com/whitequark/parser/blob/master/doc/AST_FOR...
Re:Rubysyn: Clarifying Ruby's Syntax and Semantics by petalmind on Sunday April 05, 2026 @02:29PM (#47652397)
Do you know if Redex could be a tool that would be useful in my situation?

Claude suggests it, but I need to learn a lot of Redex to understand how to apply it.

I have a general understanding of what operational semantics is. Or maybe, are there any Redex implementations for common programming languages? \lambda_v is a bit too abstract.