Ask HN: Most desirable features in a parser for a data interchange format?
Dear HN,
If you were entrusted with the mission of designing the ideal parser for a data interchange format (say XML, JSON, YAML, etc...) what features would you add?
If you were entrusted with the mission of designing the ideal parser for a data interchange format (say XML, JSON, YAML, etc...) what features would you add?
Here are some features (sometimes mutually incompatible) that parsers can have:
* fast
* low memory consumption
* streaming operation
* building a complete document tree
* streaming document chunks
* being strict
* being lenient
* being extremely lenient (handle "last Thursday" as a date)
* intelligent error handling
* intelligent error handling of errors discovered downstream (ex. some invariant of the document is found to be untrue when we are using the output of the parser, we can point the user to the line number and give a clear explanation of the problem)
* static orientation (take a document with a known schema and populate POJOs with them)
* dynamic orientation (easily handle any document without anything known about structure)
* really, really, fast
* use same parser for multiple formats (or at least look that way)