Hi folks,

I put some feedback up in a Hacker News comment
<http://news.ycombinator.com/item?id=4487588>, but it
probably makes sense to reproduce it here too, where comments
will be seen.

[By the way, Rich, I don’t use Clojure (... yet ...), but
your & Stu’s talks are always an inspiration, and I send
links to all my friends. Keep doing them!]

Cheers,
Jacob Rus

* * *

Nice advantages over JSON: more compact, easier to pretty
print, includes an integer type, non-string map keys, has a
nice built-in extension mechanism (which is much more
elegant than any ad-hoc thing that JSON can support).

Things that probably make sense coming from Clojure, but
seem somewhat unnecessary for a general purpose data
interchange format: explicit character type (as compared to
length 1 strings (which could optionally use the extension
mechanism if necessary)), separate types for vectors and
lists (seems like the extension mechanism could handle this
if it’s ever necessary; to some extent this criticism holds
for sets too, but those are also more independently useful).

One type not included that I find useful: some kind of "raw"
string wherein backslashes are interpreted literally, and
double escapes aren’t required all over the place.

Possible point of confusion that should be spelled out more
explicitly: by the grammar provided, a floating point number
requires an explicit leading digit. That is, '0.5' cannot be
spelled '.5'. (Should an implementation accept '.5' as a
number, or reject it as badly formed?)

Also, does "a floating-point number may have the suffix M to
indicate that exact precision is desired" mean that it
should be interpreted as a decimal number? Might be worth
saying that directly.

It would be nice to see a bit more guidance about "Symbols
are used to represent identifiers, and should map to
something other than strings, if possible." Perhaps this
could include examples of what Rich Hickey & al. think would
be useful interpretations in JavaScript and Python (to pick
two obvious popular examples).

Most of all, it would be nice to see a clear explicit
treatment of Unicode for strings/symbols (I’d recommend
utf-8 here), including possible ways of escaping code points
in strings. Confusions about Unicode are one of the main
points of incompatibility between JSON implementations, and
the JSON spec has more to say about the subject than this
current spec does.

One nice built-in tag to add: base64 raw data, using one of
the typical base64 encodings, which should be described in
the spec to avoid any confusion.

Question: if a tagged element is considered a unit, can
another tag be put in front of one? That is, something along
the lines of '#outer_tag #inner_tag "built-in element"',
where in the code which interprets the file, whatever object
is produced by the inner_tag's extension is sent as input to
the outer_tag's? It’s worth clarifying this so that
implementors make sure to add the case to their test suites.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to