AltME: Ren - Data Exchange Format

Messages

Gregg
And, again we're talking Ren here, is this a good thing?
Andreas
In Ren, it may be very useful to restrict potential keys slightly further, to ease interop with other languages.
For full Rebol, we could have slightly more relaxed restrictions.
In particular, I think that compound types as keys should be carefully considered for Ren.
Gregg
Yes, Ren is separate, and not only good for interop, but also a helpful constraint to require keys to be set words.
Andreas
Compound types: blocks, (parens?), maps.
Gregg
Potentially helpful. It's a tough call, because we think in terms of Redbol, and want to exchange all data seamlessly.
Agreed on compound types.
Enormous power there, if you allow anything.
Andreas
And enormous potential for problems as well, because you then need to carefully define a equivalence story as well.
But I think for primitive types, most if not all of them should be allowed as keys.
Gregg
Right.
And much more complex for interop, as you said.
Andreas
I also think that a relaxed restrictions on keys may actually be something of a "selling point" for Ren.
JSON decidedly represents "objects", which entails strong restrictions. But in practice, most implementations don't really exchange "objects" through JSON, but rather a generic associative datastructure (maps, hashtables, dictionaries). Also, because JS objects don't really fit that closely to objects in other languages.
So if we start with maps instead of objects in the first place, with relaxed restrictions on keys, we have a much closer fit to reality than JSON does.
Gregg
Agreed.
Lua comes to mind, because anything can be a key in a table, correct?
And the complexity of allowing them is offset by the consistency.

Oldes
"Ren spec needs to be kept a simple as possible, while still allowing much more expressivity than JSON."
So you should first of all not think about map! datatype, and use block! (without set-words) or object! (if you want set-words as keys), but map! with just set-word! key is a nonsense.
Oldes
One of real life examples why to use map! (or hash!) instead of block! or object! would be unicode collation http://unicode.org/Public/UCA/6.3.0/allkeys.txt - I don't see any usage there for set-word! keys. But I probably don't understand the main purpose of REN :-)

Last message posted 406 weeks ago.