3 ms·
> Then XML came along in 1998. Useful context for the youngsters: Tim invented XML. I mean, techically, there were a few other people who helped write the spe
by kragen 7y ago
> Then XML came along in 1998.
Useful context for the youngsters: Tim invented XML. I mean, techically, there were a few other people who helped write the spec, but Tim was using more-or-less XML in shipped applications before they got involved.
In my book, that means his opinion about the importance of bits on the wire is pretty weighty, but you also shouldn't discount the possibility that he's in some sense constitutionally inclined toward standardized data formats.
About other data formats:
I have some experience with CBOR which I regret; it's more compact than JSON, but it's usually not significantly more compact than gzipped JSON, and it's usually slower than JSON, which is saying something, and is surprising given that no scanning for delimiters is needed. Its only real advantage is that you can safely include binary blobs. It's worth noting that originally CBOR was part of MessagePack until its author decided to fork it off and name it after himself, Carsten Bormann.
Cap'n Proto, FlatBuffers, and SBE (which I guess is too obscure for Tim to mention) get their "deserialization in negative nanoseconds" by virtue of not deserializing; instead, the respective libraries access the desired fields of the serialized data in place, which involves an extra pointer indirection or two and possibly some byte swapping, so it's a little slower than accessing fields of native structs. But it means you don't have to parse the entire data structure, just the parts you're accessing, so you can do things like memory-map a read-only data file instead of parsing it. In many cases, even if you're accessing the whole thing, saving the extra memory copy is actually worth more performance than avoiding the byte-swapping and indirections. This is not a new idea — COBOL was based on it, though without these systems' extensibility and consequently without the cost of the extra indirections — but it's an extremely effective idea in many contexts.
All of FlatBuffers, Cap'n Proto, SBE, Protobufs, Thrift, and I think Avro do have support for adding new fields, contrary to what Tim says about binary formats in his note; but they mostly do presuppose that those new fields are being defined by some central authority, because there are things like sequentially assigned field IDs, so certainly you don't have the level of safe extensibility that you have in JSON (or HTTP or RFC-822 mail or HTML forms or SNMP ASN.1 BER data or, of course, XML and HTML tags and attributes).
- timbray 7y agoAhem. No I didn't: https://www.tbray.org/ongoing/When/200x/2008/11/22/Not-the-Inventor-of-XML https://www.tbray.org/ongoing/When/200x/2008/11/22/Not-the-I... But, I was there, and it's an interesting story: https://www.tbray.org/ongoing/When/200x/2008/02/10/XML-People https://www.tbray.org/ongoing/When/200x/2008/02/10/XML-Peopl...
- kragen 7y agoHeh, sorry to have fulfilled your prophecy. But, weren't you deploying a schema-free SGML app by virtue of not using implied end tags a couple of years before? Because that sure sounds like XML to me...
- timbray 7y agoYeah, but others were as well, it was obvious to anyone who understood both SGML and the Web. Mind you, there were only maybe a dozen people in the world like that.
- kragen 7y agoAnd one of them was Erik Naggum, who understood the Web but hated it. He probably wasn't the only one who self-selected out of the pool of possible XML inventors... BTW, it's mentioned in another thread above that you're not sending a Content-Type header — are you doing that on purpose? I haven't tried doing that since HTTP/0.9 days and I'm surprised it works (i.e., that modern browsers sniff the body and render it as HTML).
- tempguy9999 7y agoI'm curious; could you explain/link to some explanation of Eric Naggum's views that showed why he disliked the web. Thanks.
- tialaramex 7y agoTo be fair, most of those "extensible" formats aren't safely extensible. ASN.1 is because it uses OIDs, and some scenarios in XML and parts of HTTP are safely extensible because they use URIs, but anywhere which relies on just arbitrary text, like JSON, is just shrugging when it comes to global collisions. What I'm getting at here is, OIDs and URIs are globally namespaced. When I decide to add my own custom foo to a format, OIDs let me go get myself an arc and assign foo an OID from that arc, and URIs let me go get myself an FQDN and then assign foo a URL with that FQDN. In HTML if I just add a foo attribute that collides with everybody else's foo attribute, in RFC-822 mail my foo header can collide with anybody else's foo header. And so on.
- kragen 7y agoIn theory, I sympathize with this view, but it doesn't really seem to be much of a problem in practice. I don't think I've ever seen a colliding RFC-822 header name or HTML tag name. (There are lots of problems with RFC-822 but colliding header names are not one that I've seen.) I have occasionally had problems in SNMP where the meaning of the same OID changed from one version of a MIB to the next. I don't think I've seen XML namespaces maliciously collided, but there aren't very many of them, maybe a couple dozen in mainstream use. I think this is sort of like how Wikis don't work in theory but do work in practice. One nitpick: I don't think the extensibility of SNMP is due to ASN.1 but due to the key-value semantics of SNMP. It's true that the keys are OIDs, and the OIDs are delegated to organizations to avoid collisions (by the ITU I guess), but if you have a field in some arbitrary ASN.1 syntax that is just an OID, that doesn't give you any kind of backward-compatible extensibility. However, although I spent a couple of years struggling with SNMP on a daily basis, I'm not an expert on ASN.1 by any means, so I could be mistaken about this.
- tialaramex 7y agoI get your point that yes, you could use ASN.1 in a way that isn't extensible. To pick a nit in your nit though: OIDs are arranged in a hierarchy, so anybody who already has an arc can just delegate you an arc from their part of the hierarchy, much the same way foo.example could delegate kragen.foo.example to you, and then you could delegate tialaramex.kragen.foo.example from that to me and so on. The IETF hijacked the 1.3.6.1 arc, by basically arguing that if hypothetically the US Department of Defence were asked to delegate them the 1.3.6.1 arc from its 1.3.6 arc it would doubtless agree, and so no need to actually ask... For example 1.3.6.1.5.5.7.3.1 is "serverAuth" the OID used to indicate that an X.509 certificate is intended to identify a TLS Server, that was assigned by the IETF's PKIX many years ago. But the IETF has an arc under 1.3.6.1 for giving out OID arcs to anybody who needs one, 1.3.6.1.4.1, you can just fill out a form for IANA explaining why you need one (e.g. to make some new SNMP features work) and you'll get an arc back typically within a few days. e.g. 1.3.6.1.4.1.44947 is ISRG, the charity which provides the Let's Encrypt service. Colliding HTML tag names has been a problem, albeit a small one, even inside "standard" HTML itself because of the conflict between WHATWG and W3C for years. The small number of web browsers with significant market share made this less serious than it might be. As to people redefining MIB OIDs, I can't help idiots, I would regard every instance of this happening as a bug in the later definition.