gritzko / ron

(dated, see the site) Replicated Object Notation, a distributed live data format, golang/ragel lib
http://replicated.cc
Apache License 2.0
360 stars 7 forks source link

Proposal: Add double quotes for strings and deprecate single quotes #30

Closed cblp closed 6 years ago

cblp commented 6 years ago

Reason: simplify string encoding be removing extra single quote substitution. Single quotes induce extra complexity on encoding algorithm (extra escaping of ' symbol).

No, it's not significantly handy to write

var ron = "*lww #object @time :field 'value' ;"

in the real client or server code. Nobody should write such code. RON is a wire format, a Swarm user doesn't write it.

(Maybe in tests somebody would write such code. But it's not what we must optimize.)

gritzko commented 6 years ago

To accept the change, I have to change all the parsers first. At least, they must accept double quotes.

gritzko commented 6 years ago

Why deprecate single quotes? They are very handy when writing RON strings in basically every language.

var ron = "*lww #object @time :field 'value' ;"
cblp commented 6 years ago

Why deprecate: Single quotes induce extra complexity on encoding algorithm (extra escaping of ' symbol).

No, it's not significantly handy. Nobody should write

var ron = "*lww #object @time :field 'value' ;"

in the real client or server code. RON is a wire format, a Swarm user doesn't write it.

(Maybe in tests somebody would write such code. But it's not what we must optimize.)

cblp commented 6 years ago

To accept the change, I have to change all the parsers first.

You don't have to. The implementation may catch up the Spec later.