5 ms·
I've made this comment before. It seems to me that there is an almost unsolvable information theoretic problem with the human language spec approach. Browsers n
by BenoitEssiambre 5y ago
I've made this comment before. It seems to me that there is an almost unsolvable information theoretic problem with the human language spec approach. Browsers need to have a standard specification for interoperability and one that includes an open source reference implementation of the core parts. Chromium seems to have become that standard.
I argue here against pure natural language specifications in favor code based specs. I just don't think human language is nearly precise enough to write an adequate specification. Natural language words are incredibly polysemic and contextual. Look for example, at how many meanings the word "break" has: https://www.merriam-webster.com/dictionary/break https://www.merriam-webster.com/dictionary/break
Kolmogrov has long ago suggested that fully specified information distills down to a computer program: https://en.wikipedia.org/wiki/Kolmogorov_complexity https://en.wikipedia.org/wiki/Kolmogorov_complexity, https://en.wikipedia.org/wiki/Minimum_description_length https://en.wikipedia.org/wiki/Minimum_description_length
The ideal language for a pure specification might be a mix of natural language and pseudo code with a pseudo test suit. However, if you are writing that, you might as well go one step further and write working testable code.
Other technical fields usually go beyond language for specifications, using blueprints and diagrams which are their version of code.
There is also an history of trying to tackle the inadequacy of natural language for technical specifications. A pioneer of this is Donald Knuth with his Literate Programming (https://en.wikipedia.org/wiki/Literate_programming https://en.wikipedia.org/wiki/Literate_programming) and the descendant concepts of having code with extractable inline comments that you can use to auto generate documentation. https://en.wikipedia.org/wiki/Documentation_generator https://en.wikipedia.org/wiki/Documentation_generator
I would argue that modern platforms with pull request based workflows that tie discussions to version controlled code changes are also the progression of this line of thought.
A cleaned up version of these might make sense for a specification.
And I get some of the concerns. While natural language under specifies, reference implementations over specify. This is more of a problem with low level languages however. Modern, high level languages are getting fairly close to a form of pseudo code. I fully agree that the reference implementations shouldn't contain or should hide, low level optimizations. I also understand that reference implementations can unduly tie specs to specific hardware, OSs and platforms.
But to me, over-specification is less of a problem than under-specification and it can be mitigated by labeling particular functions or blocks of code as implementation specific and not part of the spec.
Without spec written in code, the different implementations always have subtle incompatibilities. I see egregious versions of under-specification in government where horrendously vague specs are created in order to issue RFPs for getting software built. They usually end up with non working software at mind blowing cost.
People have this weird misconception that they are contracting out to build software. They are not. Building software is really easy. You press the build button or type the compile command. Building software has been fully automated for a while now. What is difficult is designing software and specifying what it must do. This is because there is a vast jungle of protocols, business flows, hardware and software platforms that need to be interacted in different ways for different needs. This is what needs to be specified and only computer code can do it adequately.
I wish that Mozilla adopted the chromium core. We really need a well funded non-profit managed release of the reference browser.
- the8472 5y agoThe HTML5 specs are to some extent code disguised as human language. E.g. https://html.spec.whatwg.org/#user-activation-processing-model https://html.spec.whatwg.org/#user-activation-processing-mod...
- deleted 5y ago[deleted]
- mmastrac 5y ago> I wish that Mozilla adopted the chromium core. We really need a well funded non-profit managed release of the reference browser. At that point you may as well just cede the w3c to Google itself unless you've magically disentangled it from Google's business interests.
- StillBored 5y agoWhat you say is true, and the way to solve it is a small minimal spec rather than these 5k page ones that try to describe every bit of detail. HTML4/javascript/css were eminently approachable, the problem is the loads and loads of edge case API's/etc that have been stuffed into the browser to make it a "platform" are the problem these days. The browser IMHO should have been allowed to be something you write applications in, rather than a fancy display terminal. There are no ends of technical reasons why its a bad idea, but you have a couple powerful corps that see it in their interest (because they can control it) so it happened. As soon as you start to create "platforms" its inevitable that a single organization will monopolize it.
- AnIdiotOnTheNet 5y agoLately I've been thinking that the "perfect" programming language would be a specification language that precisely defines the relationship between outputs and inputs. Given that, the next step is to 'compile' this specification to a set of tests and (possibly naive) implementations. Profiling then tells the programmer which components of the implementation need improvement and the programmer touches them up and the test verifies they are still correct.
- mcdonje 5y ago> However, if you are writing that, you might as well go one step further and write working testable code. I disagree there. Not in every circumstance. If the people on the business side are devs, then sure. Technical-minded non-devs can be taught to write their specs in a domain-specific pseudo-language without needing to learn about implementation details or deeper programming language knowledge/concepts, or deal with technical debt. Something on the order of writing JSON for an API. >I just don't think human language is nearly precise enough to write an adequate specification. Standard language, no. Several fields such as law, sciences, philosophy handle it by defining their own jargon. The first year of university often focus on onboarding students to the terminology so they can effectively communicate on the subject matter and understand papers. Natural language version of DSLs.