News for hackers. Stuff that matters.
Re:JSON with Commas and Comments by aaron-santos on Monday February 22, 2021 @01:42PM (#26228514)
> Yes, Doug Crockford deliberately removed comments from JSON but people keep putting them back in. If we’re going to have comment-enriched JSON (e.g. for human-editable configuration files), we might as well have a standard one.

The text "deliberately removed comments from JSON" links to https://web.archive.org/web/20150105080225if_/https://plus.g... where Doug not only explains the reason, but also a solution which works with the existing standard. It's imperative that the JWCC author explain what they find lacking in Doug's solution - stripping comments before handing off the a JSON parser. A new format is a really weird way to go about fixing a problem that already has a solution.

Re:JSON with Commas and Comments by BugsJustFindMe on Monday February 22, 2021 @05:42PM (#26231669)
Crockford regularly displays a stunning degree of tunnel vision.

Without a standard format for comments, you have no reason whatsoever to expect the ad-hoc comments in a JSON file made by anyone who isn't you to be styled like JavaScript comments. And if your response is "then everyone needs to use JavaScript-style comments", well, TA-DA, you've just added comments to the spec. You can't have it both ways.

> It's imperative that the JWCC author explain what they find lacking in Doug's solution - stripping comments before handing off the a JSON parser

If the syntax rules for adding comments are unspecified, then the the syntax rules for what to strip out are unspecified too!

Re:JSON with Commas and Comments by tshaddox on Monday February 22, 2021 @09:13PM (#26233132)
I wish JSON supported comments, but I don’t really understand your criticism. You say:

> Without a standard format for comments, you have no reason whatsoever to expect the ad-hoc comments in a JSON file made by anyone who isn't you to be styled like JavaScript comments.

But, since comments are not supported in JSON, you can expect JSON from external sources to contain no comments whatsoever.

That’s precisely Crockford’s point: he didn’t want the format to have a comment syntax that works across different parties so that the only way to use comments is internally, i.e. with a custom comment syntax that you strip before interacting with external sources.

Re:JSON with Commas and Comments by hn_throwaway_99 on Monday February 22, 2021 @09:31PM (#26233224)
I can't believe that anyone who has ever wanted to comment a package.json file could think Crockford's argument is anything but nonsense. The problem is these files are both edited by humans, and by a plethora of tools. Without a standard comment format, it's been a nightmare trying to comment package.json file in a way that doesn't break something in the NPM/Node ecosystem.
Re:JSON with Commas and Comments by didibus on Monday February 22, 2021 @09:53PM (#26233358)
Using JSON for configuration could be the mistake? That wasn't the original goal of JSON.
Re:JSON with Commas and Comments by coldtea on Monday February 22, 2021 @10:45PM (#26233603)
>That wasn't the original goal of JSON.

That's neither here, nor there. The narrow vision many/most tools were created with is laughable compared to the actual creative uses people put them into.

Heck, the internet wasn't created for collaborating, socializing, shopping, reading, listening to music, etc., anyway, it was created to have a war-proof network for army use, yet here we are...

Re:JSON with Commas and Comments by eesmith on Tuesday February 23, 2021 @01:53AM (#26234515)
ARPANET, the direct predecessor for the internet, was created for collaborating, including socializing and reading. It was NOT created to "have a war-proof network for army use". The latter is a pernicious falsehood.

Quoting https://en.wikipedia.org/wiki/ARPANET :

> It was from the RAND study that the false rumor started, claiming that the ARPANET was somehow related to building a network resistant to nuclear war. This was never true of the ARPANET, but was an aspect of the earlier RAND study of secure communication. The later work on internetworking did emphasize robustness and survivability, including the capability to withstand losses of large portions of the underlying networks.[51]

See also Licklider's work with https://en.wikipedia.org/wiki/Intergalactic_Computer_Network leading up to ARPANET, or his "The Computer as a Communications Device" - https://signallake.com/innovation/LickliderApr68.pdf where he describes how the network might be used:

> You will not send a letter or a telegram; you will simply identify the people whose files should be linked to yours and the parts to which they should be linked-and perhaps specify a coefficient of urgency. You will seldom make a telephone call; you will ask the network to link your consoles together,You will seldom make a purely business trip, because linking consoles will be so much more efficient. When you do visit another person with the object of intellectual communication, you and he will sit at a two-place console and interact as much through it as face to face. If our extrapolation from Doug Engelbart’s meeting proves correct, you will spend much more time in computer-facilitated teleconferences and much less en route to meetings.

and has a section titled "On-line interactive communities":

> Available within the network will be functions and services to which you subscribe on a regular basis and others that you call for when you need them.In the former group will be investment guidance, tax counseling, selective dissemination of information in your field of specialization, announcement of cultural, sport, and entertainment events that fit your interests, etc. In the latter group will be dictionaries, encyclopedias, indexes, catalogues, edit-ing programs, teaching programs, testing programs, programming systems, data bases, and—most important—communication, display, and modeling programs.

Collaboration and reading were surely some of the main goals in the vision that became ARPANET.

Re:JSON with Commas and Comments by coldtea on Tuesday February 23, 2021 @04:14AM (#26235279)
From the very page you link to:

Nonetheless, according to Stephen J. Lukasik, who as Deputy Director and Director of DARPA (1967–1974) was "the person who signed most of the checks for Arpanet's development:

"The goal was to exploit new computer technologies to meet the needs of military command and control against nuclear threats, achieve survivable control of US nuclear forces, and improve military tactical and management decision making."

Re:JSON with Commas and Comments by eesmith on Tuesday February 23, 2021 @06:00AM (#26235895)
That quote was immediately after a quote from Charles Herzfeld, ARPA Director:

> "The ARPANET was not started to create a Command and Control System that would survive a nuclear attack, as many now claim. To build such a system was, clearly, a major military need, but it was not ARPA's mission to do this; in fact, we would have been severely criticized had we tried."

History's complicated, isn't it?

So, we look at other things: Licklider became Program Director at ARPA in 1962 and ARPANET started in 1966 (which is when Lukasik joined as Director of Nuclear Test Detection before becoming A.D. the next year, then Director in 1971). And as Lukasik writes in his paper, the late 1960s were a different funding era than the early 1960s when Herzfeld's "foundling" started.

Recall that the 1968 Mansfield Amendment prohibited military funding of research that lacked "a direct or apparent relationship to specific military function" - far different than the Ruina years where office directors and program managers had significant autonomy and funding authority. An effective ARPA director after the Mansfield Amendment was passed is going to be someone who is good at viewing ARPA projects through that military support lens, yes? Which might be different than the lens used earlier?

Next, quoting https://en.wikipedia.org/wiki/Robert_Taylor_(computer_scient... :

> Taylor hoped to build a computer network to connect the ARPA-sponsored projects together, if nothing else, to let him communicate to all of them through one terminal. By June 1966, Taylor had been named director of IPTO; in this capacity, he shepherded the ARPANET project until 1969.[11] Taylor had convinced ARPA director Charles M. Herzfeld to fund a network project earlier in February 1966, and Herzfeld transferred a million dollars from a ballistic missile defense program to Taylor's budget.

It therefore seems very much like collaboration, at the very least, was indeed part of ARPANET's goals when it started in 1966.

FWIW, as Martin Campbell-Kelly and Daniel D Garcia-Swartz point out, at https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.58...

> ARPANET network was one among a myriad of (commercial and non-commercial) networks that developed over that period of time – the integration of these networks into an internet was likely to happen, whether ARPANET existed or not.

They further consider it "Whig history" to think ARPANET plays a critical role in the modern day internet.

And I agree with that assessment.

Re:JSON with Commas and Comments by coldtea on Wednesday February 24, 2021 @12:46AM (#26247013)
>History's complicated, isn't it?

Yes, but in the end it's he who pays the bills who decides. Without them it's lights out.

Re:JSON with Commas and Comments by eesmith on Wednesday February 24, 2021 @12:53AM (#26247047)
Herzfeld paid the initial bills. Herzfeld said "ARPANET was not started to create a Command and Control System that would survive a nuclear attack".

Lukasik came in later, and had no signing authority or supervisory position on the initial ARPANET work.

Following your guideline, the ARPANET therefore wasn't "created to have a war-proof network for army use"; that was a design goal which came later, after the collaboration goal.

Re:JSON with Commas and Comments by qyv on Monday February 22, 2021 @11:41PM (#26233884)
Who is to say what to legitimate use and what is misuse of a creation if not the creator?
Re:JSON with Commas and Comments by coldtea on Tuesday February 23, 2021 @12:13AM (#26234027)
Obvioysly the world at large.

Would you consider your use of fire (e.g. for cooking) "illegitimate" if the creator of fire said so? ("No, must eat food raw! Fire is meant for heating only! Ugh!").

Re:JSON with Commas and Comments by hn_throwaway_99 on Monday February 22, 2021 @11:50PM (#26233928)
The people who use it.

It's like the inventor of gif declaring it is pronounced 'jif'. Who cares, basically nobody else says it like that.

Re:JSON with Commas and Comments by ncallaway on Tuesday February 23, 2021 @12:08AM (#26234001)
What if it's a goal of JWCC?
Re:JSON with Commas and Comments by tracker1 on Tuesday February 23, 2021 @04:33AM (#26235404)
I think TOML and YAML are both better for configuration files.
Re:JSON with Commas and Comments by jtdev on Monday February 22, 2021 @11:26PM (#26233816)
Exactly, hasn’t NPM caused enough problems? Now you want to spread that mindset to JSON?
Re:JSON with Commas and Comments by tshaddox on Monday February 22, 2021 @09:36PM (#26233257)
The fact that lots of people want to comment their package.json file and can’t easily due to Crockford’s decision does not mean that Crockford’s argument is nonsense. Crockford’s argument is not that there shouldn’t be comments in JSON because no one would want to use them. And again, I would also like to have comments in JSON.
Re:JSON with Commas and Comments by hn_throwaway_99 on Monday February 22, 2021 @10:32PM (#26233557)
My point is that I don't buy Crockford's argument, at all, against having comments in JSON. "I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability".

So instead you have people coming up with a million different bad hacks to support comments in non standard ways (e.g. "fake comment" properties, duplicate keys, etc.) Coupled with the fact that since it's not in the standard, you never really know if the file you're creating may be read by something that won't strip comments. It's the worst of all possible worlds in my opinion, with 0 benefit.

Re:JSON with Commas and Comments by tshaddox on Monday February 22, 2021 @11:50PM (#26233935)
I’ve personally never encountered any combination of JSON-encoded data and JSON parser that didn’t work perfectly together. I don’t know whether the right trade-offs were made between interoperability and other features, but I’d say it’s very clear that if interoperability was a chief design goal, it was executed extremely well.
Re:JSON with Commas and Comments by hn_throwaway_99 on Tuesday February 23, 2021 @12:22AM (#26234075)
I don't understand why you keep making the same circular arguments. If the lowest-level standard for JSON-encoded data also included comments and trailing commas, than I have no doubt that every combination of JSON-encoded data and JSON parser would be able to parse that. Instead, it wasn't put in the lowest level spec, so instead what you have are lots of individual parsers with non-compatible custom flags. If Crockford's argument was "I got rid of comments because people were using them for preprocessor directives", then he just made the problem a million times worse because now there are a million different, incompatible "preprocessor directives" that are just implemented as basically command line args now if a user wants to have a very basic feature, which is comments.
Re:JSON with Commas and Comments by tshaddox on Tuesday February 23, 2021 @01:01AM (#26234258)
> If Crockford's argument was "I got rid of comments because people were using them for preprocessor directives", then he just made the problem a million times worse because now there are a million different, incompatible "preprocessor directives"

No, because his goal was to make JSON a highly-compatible interchange format, which it is! There are roughly zero incompatible preprocessor directives, and roughly zero problems using JSON to exchange data between parties. Seriously, when have you received JSON that you couldn’t immediately parse with your standard JSON parser of preference? The fact that some people might devise their own tools to store incompatible JSON on their end with things like comments, and strip those things out when transmitting them in order to make them compatible JSON, does not qualify as an incompatible preprocessor directive. On the contrary, thats precisely the intent of the choice to not have comments in JSON.

Re:JSON with Commas and Comments by BugsJustFindMe on Tuesday February 23, 2021 @01:46AM (#26234488)
> Seriously, when have you received JSON that you couldn’t immediately parse with your standard JSON parser of preference?

Every single time for any non-mediocre definition of parsing. JSON has no way to transmit the meaning of values, no datetimes, no units, no sets, nor any other semantic attribute. That means your "parsed" result is always useless and wrong on its own, literally a lesser-dimensional projection of the original information, until you interpret it again in an entirely ad-hoc custom manner. Wouldn't it be nice if you could store instructions inline for how to do that.

Re:JSON with Commas and Comments by nooorofe on Tuesday February 23, 2021 @02:47AM (#26234797)
JSON schema exist exactly for that reason, hacks like adding type is just nonsense. If somebody need comments, types it - XML has all that. Also how hard is to write {"type": "datetime", "value": "2021-02-23 12:46:37.07"}?
Re:JSON with Commas and Comments by BugsJustFindMe on Tuesday February 23, 2021 @03:12AM (#26234930)
> JSON schema exist exactly for that reason, hacks like adding type is just nonsense

Creating schemas for declaring types is literally a hack for adding type! I think its very bizarre to say "You dont need to do X because you can just do X."

> Also how hard is to write {"type": "datetime", "value": "2021-02-23 12:46:37.07"}

"datetime" isn't a universal format specification. 2021-01-10 could be October 1 or January 10. What time zone is this in? Local to the sender, UTC, local to the recipient, somewhere else? Is this a 24 hour clock or something that gets a modifier for the other half of the day? You're making some classic mistakes that people make when they don't think about the complexity of the problem domain of communicating information unambiguously.

Re:JSON with Commas and Comments by nooorofe on Wednesday February 24, 2021 @09:02AM (#26249894)
> Creating schemas for declaring types is literally a hack for adding type!

It is a "communication protocol" - base of any messaging system. Message has header with protocol name and version: HTTP, TCP, DB connection, SOAP, any message queue - everything working that way.

> "datetime" isn't a universal format specification. than use another (see the comment above)

self-contained message is anti-pattern

Re:JSON with Commas and Comments by BugsJustFindMe on Tuesday February 23, 2021 @12:53AM (#26234218)
> I’ve personally never encountered any combination of JSON-encoded data and JSON parser that didn’t work perfectly together.

As recently as 2017, the Google Translate API used to return completely invalid JSON with empty array indices instead of nulls ([,,,] instead of [null,null,null,null]). This broke several JSON parsers until they patched around Google's cavalier abuse of the language. Your experience of everything always working perfectly doesn't mean that everything always works perfectly.

Re:JSON with Commas and Comments by tshaddox on Tuesday February 23, 2021 @01:09AM (#26234294)
That sounds more like a bug that, because the group responsible for the bug didn’t fix the bug and was extremely important to the community, developers of JSON parsers had to put in bug fixes on their end instead. I’m not familiar with the details of that event, but it doesn’t sound like anyone was actually accepting this as a new valid variant JSON, and AFAIK it didn’t lead to the propagation of different variants of JSON that are both in significant use but are incompatible. Or to put it another way, I don’t think people need to worry about whether they’re using “Google Translate JSON” or “Standard JSON.”
Re:JSON with Commas and Comments by BugsJustFindMe on Tuesday February 23, 2021 @01:39AM (#26234444)
> I’m not familiar with the details of that event, but it doesn’t sound like anyone was actually accepting this as a new valid variant JSON

When they accept it, it becomes defacto valid. That's how acceptance works.

See also http://seriot.ch/parsing_json.php#41 for a big table of "JSON-encoded data and JSON parser that didn’t work perfectly together". Read the whole page though. It's quite enlightening.

Re:JSON with Commas and Comments by BugsJustFindMe on Tuesday February 23, 2021 @02:07AM (#26234593)
> he didn’t want

He didn't want. That's great, but using JSON doesn't magically eliminate the need for documenting what things _mean_. Oh, this text isn't just text and is actually a datestamp? Oh, this array isn't allowed to have repeat values? Oh, the valid values for this field are "red", "yellow", "purple", and 5? You could have had that documentation inline. Instead you're forced to have it somewhere else because the need for documentation didn't magically vanish when Crockford waved his wand.

All that eliminating comments accomplishes is needlessly limiting the utility of an otherwise mostly fine format. JSON could have been a good configuration language. Instead it isn't and apparently people have to fight to justify fixing that.

Re:JSON with Commas and Comments by coldtea on Monday February 22, 2021 @10:42PM (#26233591)
>But, since comments are not supported in JSON, you can expect JSON from external sources to contain no comments whatsoever.

You can expect it, and then you'd be suprised when they do.

See people really want/need comments, and they're gonna implement them anyway in dozens of little parsers/libs, and you're gonna have to deal with files having them anyway...

Re:JSON with Commas and Comments by pseudalopex on Monday February 22, 2021 @09:46PM (#26233311)
You can expect JSON from external sources to be a JSON like notation their parser accepts. Not JSON always.
Re:JSON with Commas and Comments by ethanwillis on Monday February 22, 2021 @08:41PM (#26232934)
If the rules are unspecified the only thing you wouldn't be able to put in comments are what is specified as JSON syntax. If you add minimal specifications for escape sequences then even that is allowed.
Re:JSON with Commas and Comments by BugsJustFindMe on Monday February 22, 2021 @09:07PM (#26233097)
> If you add specifications then

Indeed.

Re:JSON with Commas and Comments by colejohnson66 on Monday February 22, 2021 @08:21PM (#26232820)
If I’m going to use “JSON with comments” that I have to run through a preprocessor before parsing, why not just use a language where comments are explicitly allowed (YAML, TOML, etc.)? Crockford’s answer is not a solution. His words can be rewritten as: “you want comments? Use a different language that looks and feels like JSON, but isn’t.” All that does is add confusion.

The only reason JSON is as popular as it is is because JavaScript parses it natively (JSON.parse is defined by the JS spec).

Re:JSON with Commas and Comments by redisman on Monday February 22, 2021 @11:00PM (#26233669)
> The only reason JSON is as popular

I mean I remember using XML for serialization back in the day and how it made we want to kill anyone who was involved in its creation. JSON won because it’s a great and simple standard and yes because it maps 1:1 to js. It was very popular with people who hated js when it came out too - just because of how much better it was than the other options

Re:JSON with Commas and Comments by hn_throwaway_99 on Monday February 22, 2021 @11:36PM (#26233863)
I think the move from XML to JSON mirrored a lot of the overall switch in the software industry at large from unnecessarily overly complicated "design-by-committee" specs to simple, get-shit-done practicality. (Heck, anyone remember the horror that was the original EJB spec, or god forbid, CORBA?) The rise in scripting languages like Python and JS on the backend is another example of this.
Re:JSON with Commas and Comments by enw on Tuesday February 23, 2021 @02:56AM (#26234843)
And I see this obsession in some people in the industry trying to prematurely optimize every drop in their code, but they don't understand the added complexity results in inefficiency (mostly lost improvement potential) in the long-term.
Re:JSON with Commas and Comments by coldtea on Monday February 22, 2021 @10:41PM (#26233585)
>Doug not only explains the reason

Just because he had a reason to give doesn't mean it wasn't a bad reason. His stated reasoning failed with hindsight.

(a) People already do what he thought was preventing (custom parser behavior) by removing comments, (so his choice failed to prevent what he wanted to prevent)

(b) people have already created dozens of JSON parser variants that accept comments, because we really want those. And not just some niche devs - Microsoft and dozens of other big companies have tools that accept JSON + dangling commas + extra comments (so his choice was second-guessed and bypassed anyway, just in ad-hoc ways instead of a better universal one).

It wasn't his place to define whether we get comments or not based on some potential parser abuse. But he did it, and now we're stuck with that decision...

Re:JSON with Commas and Comments by rswail on Wednesday February 24, 2021 @04:14AM (#26248124)
> It wasn't his place to define whether we get comments or not based on some potential parser abuse. But he did it, and now we're stuck with that decision...

He was writing the specification, of course it was his place to do so. Who else would be in the right "place" to write his own specification that no one was enforced to use.

Re:JSON with Commas and Comments by sagonar on Tuesday February 23, 2021 @05:41AM (#26235763)
I disagree, he has DONE a common data format that works. If you do mod it, for example add comment to the data sent, 99.9% of the people agree, it is no longer JSON.
Re:JSON with Commas and Comments by coldtea on Wednesday February 24, 2021 @12:48AM (#26247022)
Which is neither here, nor there.

People still do it, and they still call it JSON. Heck, many JSON parsers, who otherwise work fine with regular JSON still accept it.

Even parsers using a different name like JSONC still allude to the JSON connection - and still are an argument that people found a lack in JSON.

Etymology/originology never produced much benefit over pragmatic non-prescriptive examination of how people use things. If anything, it helped confused the situation with pedantic objections.

Re:JSON with Commas and Comments by Lazare on Monday February 22, 2021 @09:29PM (#26233210)
Given the number of times people have invented and re-invented JSON + comments, I think it's clear there is a demand for JSON + comments, and that Crockford's view that you can solve everything by asking people to manually strip the comments out before parsing the JSON isn't viable.
Re:JSON with Commas and Comments by jtdev on Monday February 22, 2021 @11:29PM (#26233827)
Petabytes of JSON formatted data flowing across the internet every second of every day disagree with your assessment.
Re:JSON with Commas and Comments by Lazare on Tuesday February 23, 2021 @02:55AM (#26234838)
And I suppose the vast amounts of XML (still!) flowing across the internet show there's no need for JSON at all, so the real mistake was even inventing JSON?

(Also, as gets pointed out every time this topic pops up on HN, including multiple times on the submission already, the main demand isn't people wanting to add comments to the JS flowing across the wire, but to config files sitting on disk. Responding to people saying "feature X would help use case Y" by noting how many people are using it for use case Z even without feature X is logically incoherent.)

Re:JSON with Commas and Comments by jtdev on Tuesday February 23, 2021 @08:47AM (#26237163)
Crockford (and many others) found that the many flaws inherent to XML warranted a new specification, so JSON was born. If you have an issue with JSON, go create your own spec, don’t shit all over the perfectly capable, simple, elegant specification that is JSON.
Re:JSON with Commas and Comments by Lazare on Tuesday February 23, 2021 @06:39PM (#26244577)
> If you have an issue with JSON, go create your own spec

And many people have. You're literally posting this in response to someone submitting the new spec they created to solve this.

I don't understand what you're trying to argue here.

Re:JSON with Commas and Comments by ledauphin on Monday February 22, 2021 @09:18PM (#26233154)
the very simple thing lacking in this solution is that sometimes you want to programmatically _add_ comments to (or preserve comments within) some output file format. If they must be stripped before parsing, then it is definitionally impossible to do either of these things.

It's not unlike saying "actual code shouldn't allow comments - you can have a separate preprocessor in your non-code file that strips those out." Sure, you could do that, but all your line numbers would be meaningless and everyone would hate the language from day 1.

Re:JSON with Commas and Comments by willtim on Tuesday February 23, 2021 @04:25AM (#26235342)
> A new format is a really weird way to go about fixing a problem that already has a solution.

Stripping comments before handing off to a JSON parser is not a full solution. For example, if the file has to be augmented with additional data and written out again, the comments would be lost.

Re:JSON with Commas and Comments by wruza on Tuesday February 23, 2021 @06:19AM (#26236035)
Formatting would be lost too (multiple newlines, array formatting, wrap limits, etc), and the order of keys. There are two separate tasks: comment json for a human and ignore that on parse(), and maintain pretty-json with all its usefulness programmatically with parseWithSyntaxStructure(). We shouldn’t mix them into one single problem, because in one case you just want multiple readers (a human and a computer) and in the other you want to rich-edit a human representation on its own.
Re:JSON with Commas and Comments by Supermancho on Monday February 22, 2021 @01:53PM (#26228705)
> a practice which would have destroyed interoperability

A baseless reason is not a compelling reason. Some imagined eventual use is not relevant to the utility and convenience. Interoperability (in this greater undefined sense posited) cannot be maintained via syntax anyway.

> stripping comments before handing off the a JSON parser.

Putting an extra processing step before use of JSON is impractical.

Re:JSON with Commas and Comments by aaron-santos on Monday February 22, 2021 @02:02PM (#26228857)
The base is the part right before that.

> I removed comments from JSON because I saw people were using them to hold parsing directives

> Putting an extra processing step before use of JSON is impractical.

Care to explain?

Re:JSON with Commas and Comments by saurik on Monday February 22, 2021 @03:40PM (#26230271)
People want to use JSON as on disk configuration files, and that's where they want the comments and trailing commas. You can either generate the configuration file from another file, which is frankly stupid annoying and leads to repositories with two copies of the same information, or modify the software that reads the configuration file to strip it before handing it to the JSON parser... which clearly "solves the problem" but also begs the question "ok, so what is the format of the actual confirmation file, then?". The answer to that latter question is more important, as the goal would then be to get everyone to standardize around that format, at which point (I guess) "JSON" would be obsolete as no one would use it and everyone would be using the new JSON wrapper format and all implementations would be designed to have a way to read that format... but like, at that point, you are just making a weird semantics argument. I think the core problem is we just have too many of these... like, what happened to JSON5? We need some reason to all rally around a single specific format of "JSON, but with comments and trailing commas (and I will personally request multi-line strings)".
Re:JSON with Commas and Comments by Supermancho on Monday February 22, 2021 @07:06PM (#26232317)
> I removed comments from JSON because I saw people were using them to hold parsing directives

Java has not been destroyed, nor any other language that uses injected behavior. Ironically, applying parsing directives are basically another tool being run (similar to a linter) so I'm not sure what he's even getting at when suggesting running yet another tool. This just complicates the ecosystem and is part of what makes javascript seem so primitive in use and syntax. Features that are counterproductive for poorly considered reasons.

Re:JSON with Commas and Comments by oblio on Tuesday February 23, 2021 @03:05PM (#26242194)
Simple example. JSON is frequently used for configuration files. Comments break syntax highlighting for JSON.

Similar thing if you want to inspect a JSON dump into a file.

Re:JSON with Commas and Comments by virgo_eye on Tuesday February 23, 2021 @05:53AM (#26235852)
If the solution is to store config in a format with comments and strip them off before handing to JSON, what should that format be? Shouldn't it be formalized? Couldn't JWCC be that format?
Re:JSON with Commas and Comments by exporectomy on Monday February 22, 2021 @11:53PM (#26233944)
Oh, it's because people were abusing them. I thought it must have been that you can't read a file then write it back out without either losing the comments or having a whole special data structure to store them in.