2 ms·
C++ had no choice about increment operators; they came to it directly from C, so anything "recognized" in the '80s would be wholly moot. If you expect to mainta
by ncmncm 5y ago
C++ had no choice about increment operators; they came to it directly from C, so anything "recognized" in the '80s would be wholly moot. If you expect to maintain that C's post-increment operator was recognized as some sort of problem in the mid-'70s, you will need documentary evidence.
As Bruce Schneier likes to say, cryptanalysis only ever gets better; it never gets worse. The best we can say about AES-256 is that it might be good enough for any chosen period, with probability declining monotonically as the period increases. But the key schedules originally published for AES-256 made it no stronger than AES-128. I don't know if that detail has been fixed in a revision, or if it is still no stronger than AES-128. For Wireguard, Jason chose ChaCha20.
It is many years too early to determine which parts of Rust are "done". What we can say with certainty is that some that were thought done will turn out not to be, some not provisioned for extensions will end up needing them, and some defaults will turn out to be regrettable but not fixable.
- tialaramex 5y ago> C++ had no choice about increment operators I don't buy this at all. Stroustrup was keen on this particular bad idea, it is even provisioned with operator overloading that has a special optional syntax so that early weak C++ compilers can overload it despite lacking a good way to distinguish the two cases. He spends two pages of the Second Edition defending this construction which, we may note, is wholly a C feature not something novel in C++: while (*p++ = *q++) ; Stroustrup apparently admires this for being terse, admitting that this chosen example is neither commonly faster nor easier to understand than alternatives. > cryptanalysis only ever gets better; it never gets worse And it did. Eventually Linear cryptanalysis breaks DES, and it is theorised (but not demonstrated) that a refined multiple linear cryptanalysis breaks DES in just 2^41 known plaintexts less than fifty years after it was standardized... Completely useless of course, but that's the state of the art after fifty years of only getting better. Work on AES has also proceeded as Bruce would suggest, and after twenty years, with just 2^254.3 operations you can do key recovery on AES-256. AES-256 doesn't actually need to be stronger than AES-128 in the sense you're talking about, 128-bits is plenty, the trick is that the larger keys defeat Grover's algorithm and thus defang hypothetical inexpensive yet powerful quantum computers. With Grover's algorithm you get to do 2^128 quantum operations instead of 2^256 conventional operations to perform a brute force attack, but you can't do 2^128 operations either because that's far too many, so you lose. > Jason chose ChaCha20 WireGuard practices zero-agility, it picks exactly one of each component and if there's a problem the entire protocol has to be refreshed. So, choosing ChaCha20 rather than AES means it's penalized slightly on fast modern general purpose hardware (e.g. your laptop) but much faster than it might be otherwise on cheap micro controllers and archaic gear, a very reasonable trade. [Modern TLS just can choose whichever both parties agree on]. > It is many years too early to determine which parts of Rust are "done". I mostly agree with this. However, there's a spectrum. I'm pretty confident that in 2050 programmers will still find core::cmp::Ordering useful, I don't think a fundamental revolution in mathematics will have rendered the idea that 5 is Less than 10 useless. In contrast core::sync::atomic::Ordering might well have fallen entirely out of use in 2050 with a very different model of concurrent programming for very different hardware where Acquire-Release semantics seem silly. Or for example I'd be astonished if "constant by default" turned out to be a bad idea but not at all surprised if "narrowing as" goes away because it turns out that's a bad idea.
- ncmncm 5y ago> I don't buy this at all. Stroustrup was keen on this... Buy it or don't, it remains 100% fact. You may abandon fact, but at the cost of remaining credibility. Where constrained to be backward compatible with C, as C++ was, there is no choice but to implement both increment operators. Period. You may insist he could have avoided implementing overloading for increment operators. But then, generic code would not work. Crippling the language to conform to your personal preference would have killed its future, and we would be discussing neither C++ nor Rust, which depends utterly on C++ for most of its design. Furthermore, I daresay you had no such preference at the time, and probably could not have expressed it if you had. Smugness about good luck is a great personal failing.
- tialaramex 5y ago> Buy it or don't, it remains 100% fact. That's not how facts work. It's a fact that C++ does have these operators, it is not a fact that this was unavoidable. And remember Swift removed these operators. Earlier versions of Swift had them, current ones don't, they were a bad idea and they're gone now. That's a thing a serious language did, not a toy language used by six PhD students, a real practical language with a population of working programmers. > Where constrained to be backward compatible with C, as C++ was ie: conditionally. C++ chooses to be somewhat compatible, but not compatible enough that medium-sized C codebases work unaltered or that larger ones can reliably be converted at all. Which shouldn't be a huge surprise as its own "compatibility" story from C++ 98 onward is likewise a trail of misery and despair. > Furthermore, I daresay you had no such preference at the time In 1982 when Stroustrup named the language C++ and thus sealed this particular deal, no probably not. I believe I did not even purchase a macro assembler (my first way to write programs that weren't in either raw machine code or Basic) until slightly after that date. And I have no doubt that insufferable teenage me thought the pair of increment operators was a great idea when he got a primitive C++ compiler (having never had a C compiler before that) some years later, his poetry and protocol design were both awful too, we certainly shouldn't put him in charge of designing a modern programming language.
- ncmncm 5y ago