You call it beautiful, but that's a fair stretch. It's more compact than JavaScript but to non-Ruby eyes, there's no real beauty to be found. It's just simple substitutions that otherwise look the same.
strings.map { |s| s.upcase }
is actually: strings.map() { |s| s.upcase }
...and this is what it's not: strings.map({ |s| s.upcase }) # Invalid
It's subtle, but it does make for a simpler, more readable syntax that lends itself to DSLs, since no parantheses are needed: validate :name { |name|
errors.add("Bad name") unless name
}
It's feasible in other languages, of course; Elixir, for example, introduces a Ruby-like "do" block syntax which is more regular than Ruby's. It might be too late for JavaScript, but I'm no parser expert.[1] Again, not sure of the correct term for this - functional style?