4 ms·
> Assuming that's true, then they should be crafting assembly code by hand. This guy, what a fucking joke. Yeah to avoid bugs instead of using these fancy comp
by asdfaoeu 11y ago
> Assuming that's true, then they should be crafting assembly code by hand.
This guy, what a fucking joke. Yeah to avoid bugs instead of using these fancy compilers (which rarely if ever are the cause of bugs) we should be assembling our programs by hand.
- titzer 11y agoI've seen people go to extreme lengths to teach compilers particular optimizations that only apply in extremely narrow circumstances. Worse, they usually end up additionally have to introduce a way for a compiler to assume invariants that would break normal programs (e.g. overcome weaknesses in alias analysis). I've seen people go to extreme lengths and rely on C++ undefined behavior to get some weird quirk out of some specific machine instruction. All of that is extremely brittle; move to a new compiler version, new compiler, or even slightly alter the code, and suddenly the optimization either stops working or the compiler generates wrong code. At some point, for extremely hot loops, there may be no choice but to write a few pages of assembly by hand. If this saves tens of thousands of lines of compiler code that doesn't generalize, and is used on thousands or millions of machines, it's worth it, IMO.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]