Looking at the various implementations of the URL/URI/IRI stack in mainstream libraries, one has to face Jon Postel's robustness ghost ?. Exhibit ? 1: Google's own net/url/url.go ? // See RFC 3986. This package generally follows RFC 3986, except where // it deviates for compatibility reasons. Indeed. A very pragmatic approach to reality, taking the robustness principle to heart: pretty much anything goes. Such is life. Exhibit ? 2: Sean Conner's own Parsing Expression Grammar ? ? ? A work of unearthly beauty which actually follows the RFC to the letter. The anti-thesis of Postel's law, as strict as the MUST imperative. Both pros and cons of Postel's injunction can be argued ad nauseam. What does Gemini want, as a protocol? Leniency as provided by Exhibit ? 1? Or strictness as demonstrated by Exhibit ? 2? It is my personal opinion that Postel's Law is the root of all evils as we know them to this day: any old garbage can travel over the pipe, and you must do your best to handle it. Good luck to you. This is nonsensical. We know better by now. Protocol MUST be strict. This is why we have them in the first place. To clearly define what's legal or not, protocol wise. What does Gemini want? ? https://en.wikipedia.org/wiki/Robustness_principle ? https://github.com/golang/go/blob/master/src/net/url/url.go Even though one would have hoped Google would have learned from Sun's mistakes. Apparently not. Perhaps the same team was involve in both Java and Go implementations. Go figure. ? https://github.com/spc476/LPeg-Parsers/blob/master/iri.lua ? http://www.inf.puc-rio.br/~roberto/lpeg/ ? https://bford.info/packrat/
It was thus said that the Great Petite Abeille once stated: > Looking at the various implementations of the URL/URI/IRI stack in mainstream libraries, one has to face Jon Postel's robustness ghost ?. > > Exhibit ? 1: Google's own net/url/url.go ? > > // See RFC 3986. This package generally follows RFC 3986, except where > // it deviates for compatibility reasons. > > Indeed. A very pragmatic approach to reality, taking the robustness > principle to heart: pretty much anything goes. Such is life. > > > Exhibit ? 2: Sean Conner's own Parsing Expression Grammar ? ? ? > > A work of unearthly beauty which actually follows the RFC to the letter. Not quite. I explicitly ignore this bit of RFC-3987: ... with the restriction that private UCS characters can occur only in query parts. as that was a bridge too far even for me. I will also decode a path like "/foo%2Fbar/" as "/foo/bar/", ignoring the sematics of the encoded slash. > The anti-thesis of Postel's law, as strict as the MUST imperative. > > Both pros and cons of Postel's injunction can be argued ad nauseam. > > What does Gemini want, as a protocol? Leniency as provided by Exhibit ? 1? > Or strictness as demonstrated by Exhibit ? 2? > > It is my personal opinion that Postel's Law is the root of all evils as we > know them to this day: any old garbage can travel over the pipe, and you > must do your best to handle it. Good luck to you. > > This is nonsensical. We know better by now. > > Protocol MUST be strict. This is why we have them in the first place. To > clearly define what's legal or not, protocol wise. > > What does Gemini want? While I do agree with the sentiment [1], allow me to play the Devil's Advocate here and mention one word: XHTML---HTML but with the strict parsing rules of XML. To say it was unpopular is an understatment. Not to mention that XML itself is unpopular (but perhaps for reasons other than its strict parsing rules). Become too strict, and people complain. -spc (But become too lax, and other people complain ... ) > ? https://en.wikipedia.org/wiki/Robustness_principle > > ? https://github.com/golang/go/blob/master/src/net/url/url.go > Even though one would have hoped Google would have learned from Sun's mistakes. Apparently not. Perhaps the same team was involve in both Java and Go implementations. Go figure. > > ? https://github.com/spc476/LPeg-Parsers/blob/master/iri.lua > > ? http://www.inf.puc-rio.br/~roberto/lpeg/ > > ? https://bford.info/packrat/
> On Dec 27, 2020, at 00:34, Sean Conner <sean at conman.org> wrote: > > Not quite. I explicitly ignore this bit of RFC-3987: > > ... with the restriction that private UCS characters can > occur only in query parts. > > as that was a bridge too far even for me. I will also decode a path like > "/foo%2Fbar/" as "/foo/bar/", ignoring the sematics of the encoded slash. "Well, nobody's perfect." -- Osgood Fielding III, Some Like It Hot, 1959
On Sat, Dec 26, 2020 at 6:25 PM Petite Abeille <petite.abeille at gmail.com> wrote: Looking at the various implementations of the URL/URI/IRI stack in > mainstream libraries, one has to face Jon Postel's robustness ghost ?. > In fairness to Jon, the context makes it clear that he did not mean what he is commonly taken to mean. Being liberal in what you expect does not mean "be willing to accept anything and make sense of it". for example: i am perfectly willing to read poetry or even prose written in lower case only, even though it is harder for me and most people to read. but i would never (except in this one email) write anything that was not conventionally capitalized. postel's law applies: i am liberal in what i accept (conventional capitals or no capitals) but conservative in what i send (conventional caps only). What Postel's law does _not_ mean is that IAMWILLINGTOACCEPTSCRIPTIOCONTINUAINENGLISH EVENTHOUGHROMANINSCRIPTIONSWEREMOSTLY like this. (Imagine pages and pages of this style. No.) That's because Postel's law is broken: I will not accept something well outside the protocol of English writing, and I will not normally send something s??? s? ??n?????p s? to read either. > > Exhibit ? 1: Google's own net/url/url.go ? > > // See RFC 3986. This package generally follows RFC 3986, except where > // it deviates for compatibility reasons. > > Indeed. A very pragmatic approach to reality, taking the robustness > principle to heart: pretty much anything goes. Such is life. > They have two conflicting rules to deal with: Postel's law and "Don't break the customer's code". There's simply no good answer to that. > Exhibit ? 2: Sean Conner's own Parsing Expression Grammar ? ? ? > The anti-thesis of Postel's law, as strict as the MUST imperative. The apotheosis of Postel's law: accept everything, and only, what the protocol says. So here's an example closer to Gemini: should %-encoding use all lower case? Most code does, so it's the conservative thing to send. But the protocol is clear: a conformant implementation has to accept both. But because people often copy broken implementations from other programmers' broken implementations, sometimes they don't even know that upper case is acceptable. Again, being conservative in what you send makes sure you can interoperate with such broken implementations. What does Gemini want, as a protocol? Leniency as provided by Exhibit ? 1? > Or strictness as demonstrated by Exhibit ? 2? > Strictness, of course, give the above. > It is my personal opinion that Postel's Law is the root of all evils as we > know them to this day: It isn't _money_ that's the root of all evil. It's the greed for money. > Protocol MUST be strict. This is why we have them in the first place. To > clearly define what's legal or not, protocol wise. > Amen. (But note that there are multiple versions of most protocols.) John Cowan http://vrici.lojban.org/~cowan cowan at ccil.org weirdo: When is R7RS coming out? Riastradh: As soon as the top is a beautiful golden brown and if you stick a toothpick in it, the toothpick comes out dry. -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20201226/0914 b422/attachment.htm>
---
Previous Thread: [user] psa: killfile
Next Thread: [ANN] announcing the outpost, a kinda sorta reddit-esque forum