logoalt Hacker News

SeriousMtoday at 8:41 AM3 repliesview on HN

> 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.


Replies

petalmindtoday at 10:23 AM

> 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).

petalmindtoday at 10:19 AM

> 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.

lifthrasiirtoday at 1:33 PM

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/

show 2 replies