Hacker News new | ask | show | jobs
by calanya 3823 days ago
It's funny to say json and edn represent data, because they are both strictly UTF8 encoded - raw bytes have to be encoded somehow (with neither standard specifying a prefer erred method) to be represented. Why is this important? Sometimes we want to embed a binary formatted piece of data (e.g. an image) as part of our data.
1 comments

Isn't that the point of the 'hashtags' in edn? If a #png arrives then your program is going to throw an exception unless you've registered a handler that reports success in decoding it?

In effect it doesn't matter than the encoding is arbitrary edn (e.g. a 150KB png could be a solitary bigint literal) because the tags prevent false-positive decodes and keep things "strongly typed".