Interesting to see this convergence of syntax. Unfortunately, it's not true that you don't have to learn a "new syntax." As often with Ruby libraries, the devil is in the subtleties.
This does not work (although I think it could):
{"foo bar": 'b'}
but this does:
{:"foo bar" => 'b'}
Without being truly JSON compatible, it's only moderately useful.
One annoyance of Ruby for me has always been that many libraries, such as Rails, allow for symbols or strings interchangeably - but only in "most" cases, often leading to head banging in the other cases.
More intrigue: the syntaxes are also mixable
{foo: 'bar', "add-a" => 'dash', :'or a' => 'space in a symbol'}
You can do it, but is it a good idea? What it implies to me is that at some point in your program, you're constructing symbols from arbitrary strings which aren't known ahead of time. This sounds like a recipe for disaster given that symbols aren't garbage collected.
This does not work (although I think it could):
{"foo bar": 'b'}
but this does:
{:"foo bar" => 'b'}
Without being truly JSON compatible, it's only moderately useful.
One annoyance of Ruby for me has always been that many libraries, such as Rails, allow for symbols or strings interchangeably - but only in "most" cases, often leading to head banging in the other cases.
More intrigue: the syntaxes are also mixable
{foo: 'bar', "add-a" => 'dash', :'or a' => 'space in a symbol'}
is valid.