4 ms·
The main problem with XML is that writing a safe XML parser is difficult. But writing, say, a safe JSON parser is not much easier; writing a safe ASN.1 parser i
by Kednicma 6y ago
The main problem with XML is that writing a safe XML parser is difficult. But writing, say, a safe JSON parser is not much easier; writing a safe ASN.1 parser is much harder. So it's not clear whether there's a better possible declarative format.
- aidenn0 6y agoWriting a safe tagged netstring parser is pretty darn easy, for many definitions of safe. There's always the issue of very deeply nested data structures causing lots of allocations, but no nested parser can avoid that. Full featured XML parsers can read arbitrary files from disk, which is usually not what you want from a data interchange format.
- AnimalMuppet 6y agoGah. I dislike XML, but I had forgotten how much I loathe ASN.1.
- earthboundkid 6y agoXML is hard to parse because they mixed compression concerns in with encoding, which is a security nightmare. What’s hard about JSON? There was some looseness around the spec for certain characters, but overall, it’s pretty straightforward.