← Back to context

Comment by phlakaton

7 hours ago

> JSON just works.

Until it doesn't: underspecified numeric types and string types; parses poorly if there's a missing bracket; no built-in comments.

For many applications it's fine. I personally think it's a worse basis for a DSL, though.

That's my point. By the time you hit "until it doesn't", you're already doing JSON, and were for a while.

Also, is "parse well if there's a missing bracket" even a desirable property? If you get files with mangled syntax, something has already gone horribly wrong. And, chances are, there is no way to parse them that would be correct.

  • By "parses well" in that case I mean "can identify where the error is, and maybe even infer the missing closing tag if desirable;" i.e. error reporting and recovery.

    If you've ever debugged a JSON parse error where the location of the error was the very end of a large document, and you're not sure where the missing bracket was, you'll know what I mean. (S-exprs have similar problems, BTW; LISPers rely on their editors so as not to come to grief, and things still sometimes go pear-shaped.)