On Fri, Sep 7, 2012 at 3:45 AM, Rich Hickey <richhic...@gmail.com> wrote: > On Sep 7, 2012, at 12:33 AM, Daniel Pittman wrote: >> On Thu, Sep 6, 2012 at 6:01 PM, Rich Hickey <richhic...@gmail.com> wrote: >> >>> I've started to document a subset of Clojure's data format in an effort to >>> get it more widely used as a data exchange format, e.g. as an alternative >>> to JSON. >>> >>> Please have a look: >>> https://github.com/richhickey/edn >> >> The current specification has two problems that have bitten us on >> other projects (and with other formats): it has no specified encoding >> for strings, and it has no native mechanism for binary data. It would >> be awesome if you could consider both in the format. >> >> Strings without encoding are an interoperability headache, even if >> they allow binary data - someone will forget to tag the data, or will >> just throw whatever random 8-bit encoding in, and problems arise. > > I'd like to simply specify UTF-8 for edn in toto.
*nod* >> Strings with a specific encoding (like JSON and UTF-8) are great, but >> they can't carry binary, so something specific is needed - and >> hopefully something better than "base64 into the string". > > Do you object to the size of base64, or the use of convention? edn is opposed > to convention, since how do you know when to apply an approach to a > particular string? That's the problem people have today with JSON - they cram > things into strings but only know to deal with them from context. The "use of convention" is by far the worst problem, for exactly the reasons you identify. The size expansion and encode/decode phase for base64 are small annoyances shipping binary data through JSON, and would be so here, so while I would like something that allowed raw binary content unmodified, base64 would be fine. > We're going to get a standard tagged literal for binary data, was considering: > > #bin "base64data" > > I'm interested in feedback on problems with that, or alternatives. #base64 feels more explicit to me, since it would also allow for other specific encodings later, but that seems reasonable enough to me. It makes explicit the form - and is what we had through YAML, which was successfully used. -- Daniel Pittman ♲ Made with 100 percent post-consumer electrons -- 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