News for hackers. Stuff that matters.
Re:Hjson, the Human JSON by nikolay on Thursday April 14, 2016 @12:40PM (#11498191)
JSON5 [0] is better as unlike Hjson, it doesn't include non-ECMASCript syntax.

[0]: http://json5.org/

Re:Hjson, the Human JSON by emodendroket on Thursday April 14, 2016 @01:42PM (#11498842)
And yet again no date format. Am I the only person who is ever inconvenienced by this? It seems like it's so obviously the most glaring flaw with JSON that I'm surprised nobody wants to fix it.
Re:Hjson, the Human JSON by rhinoceraptor on Thursday April 14, 2016 @01:48PM (#11498903)
Just use ISO 8601?
Re:Hjson, the Human JSON by emodendroket on Thursday April 14, 2016 @01:50PM (#11498924)
Sure, that would be fine. They could also use a totally wacky format, I don't care. The problem is that without a standard the JSON tools in different languages don't all agree on how to serialize dates and you end up needing to deserialize/serialize manually the smooth over the differences. The problem isn't that you can't represent dates; it's that there is no standard way to do it.
Re:Hjson, the Human JSON by _kst_ on Thursday April 14, 2016 @03:32PM (#11499671)
> The problem isn't that you can't represent dates; it's that there is no standard way to do it.

ISO 8601?

Re:Hjson, the Human JSON by emodendroket on Thursday April 14, 2016 @04:09PM (#11499936)
That's not "standard." That's one of many ways that people represent dates in JSON, because the JSON specification itself does not mandate that you use any particular representation. If you use it there is no guarantee it will be recognized as a date on the other end.
Re:Hjson, the Human JSON by Kapow on Thursday April 14, 2016 @04:54PM (#11500258)
What black hole are you sending JSON into where the only way they could know something is a date is if you use a date type? Why can't that be part of the data structure you agreed upon in order to communicate in the first place?
Re:Hjson, the Human JSON by eknkc on Thursday April 14, 2016 @06:23PM (#11500791)
Even if there is an agreed on schema, parsers can generate native Date objects on the recipient if there is a date type. When you deserialize a nested graph of objects, it's hard to convert each date to an actual date if what you get is just a string. Makes it a lot easier during integration.
Re:Hjson, the Human JSON by emodendroket on Friday April 15, 2016 @10:03AM (#11504332)
Why am I hand-writing code to supplement the parser? I mean, hell, we don't need JSON at all, why don't I just invent my own serialization format and write parsers for it in each environment I want to use it in.
Re:Hjson, the Human JSON by duaneb on Thursday April 14, 2016 @11:58PM (#11502005)
Well, it'd need to cover dates, times with time zones, date times with time zones, times without time zones, date times without time zones. Seems better pegged to the data source without thinking it out clearly.
Re:Hjson, the Human JSON by emodendroket on Friday April 15, 2016 @10:02AM (#11504323)
So? It's not like this is a complex problem nobody knows how to solve.
Re:Hjson, the Human JSON by duaneb on Friday April 15, 2016 @10:19AM (#11504472)
Agreed! But it's not so simple to just add a "date" type; it would add significant complexity to a relatively simple text format.
Re:Hjson, the Human JSON by emodendroket on Friday April 15, 2016 @10:53AM (#11504776)
Yeah, I guess, but everyone ends up implementing it anyway; the problem is they all do it in an idiosyncratic way (and one that is ambiguous... after all, maybe I really wanted that to be a string).
Re:Hjson, the Human JSON by eknkc on Thursday April 14, 2016 @04:00PM (#11499876)
That is a string. Not date.
Re:Hjson, the Human JSON by Zardoz84 on Friday April 15, 2016 @01:53AM (#11502492)
SDLang have support for date formats.
Re:Hjson, the Human JSON by emodendroket on Friday April 15, 2016 @10:04AM (#11504344)
Cool. Never used D and that's the first I've heard about it but I have respect for any system that handles this problem. :)
Re:Hjson, the Human JSON by kstenerud on Thursday April 14, 2016 @12:50PM (#11498296)
Why do you need ECMAScript syntax? It's not like you're going to directly feed a json file into a JS interpreter. Well, not unless you have a death wish.
Re:Hjson, the Human JSON by lucideer on Thursday April 14, 2016 @01:27PM (#11498695)
Because it's a syntax that needs no extra explanation.

It's not a superset, so no extra add-on features need extra doc, and it's less of a subset then JSON so the rules of what's disallowed are much simpler.