5 ms·
It's curious how the C++ standard is written with a bunch of rules, rather than an algorithm. The algorithmic version in the article is much clearer to programm
by tlb 6y ago
It's curious how the C++ standard is written with a bunch of rules, rather than an algorithm. The algorithmic version in the article is much clearer to programmers. You'd think the C++ standards committee would write the standard for programmers instead of for -- I don't even know who it's for. Bureaucrats? Tax lawyers? SF Zoning regulation enforcers?
- b20000 6y agoit's OK if you don't get it
- lionkor 6y agoit literally is OK if you dont, because its not written for C++ programmers, its written for compiler people, and, frankly, those are witches.
- WalterBright 6y ago> those are witches Ahem, warlocks. Be careful or I'll turn you into a newt.
- bregma 6y agoWe're not here to judge all compiler implementors on how they self-identify. In most non-Western cultures [0] both "witch" and "compiler writer" are gender-neutral terms for those who dabble in the mysteries of the dark arts. Perhaps a better, less gender-ambiguous term would be "sourcerer" indicating someone who deals in the miracles of transforming source code. [0] https://www.britannica.com/topic/witchcraft/Witchcraft-in-Africa-and-the-world https://www.britannica.com/topic/witchcraft/Witchcraft-in-Af...
- sesuximo 6y agoI think most standard readers are compiler writers.
- WalterBright 6y agoI suspect that the only people who've actually read the entire Standard are compiler writers :-) Note to anyone trying to implement a language - don't bother reading tutorials or textbooks on a language. Just the Standard. Otherwise you'll be sorry.
- hmry 6y agoI can confirm this, having tried implementing an ECMAscript interpreter. "I'll start with just my own knowledge and tutorials, then I'll only need to read the standard when something is ambiguous" will lead to many hours of rewriting code based on incorrect assumptions.
- 3001 6y agoLanguage lawyers
- 3001 6y agoThe level of downvotes on a Bjarne Stroustrup C++ programming language book joke[1]2] shows how much people are really familiar with the C++ ecosystem when they complain about how tedious it is. Have you really took time to learn the langauge? [1] https://stackoverflow.com/questions/tagged/language-lawyer%20c++ https://stackoverflow.com/questions/tagged/language-lawyer%2... [2] http://foldoc.org/language%20lawyer http://foldoc.org/language%20lawyer
- userbinator 6y agoIt comes from the general principle of describing the requirements of the implementation, without describing the implementation itself.
- WalterBright 6y agoStandards are written with precision and with a minimal number of words (i.e. no redundancy). This is great for implementers, as wishy-washy rules make for incompatible implementations. People really don't want to argue about interpretations of a rule. A tutorial it ain't. Neither is it a guide, an overview, a textbook, a nutshell, or a marketing document. Just the facts, Ma'am.
- remolacha 6y agoThis is done for a very good reason. Some languages have chosen to base the standard on a particular reference implementation rather than a specification. In practice, this has led to any alternative implementations of those languages having to recreate any quirks of the original implementation to prevent inconsistencies. That makes later implementations brittle and tougher to optimize. Also, specs always have a formal grammar for language syntax, and may provide a test suite that covers aspects of the language semantics.