12 ms·
Torvalds: Standards need to be questioned
- 13of40 8y ago"Honestly, pure and utter garbage you are a f*cking moron and braindamage piece of garbage horrible wrong. Completely mis-guided idiocy? Bogus shit bogus garbage, braindamage. Pure and utter bullshit. Toilet paper up my arse. Linus" Edit: Linus says it in public and it's just his gritty, bull-by-the-horns personality. Repeat it on an anonymous internet forum, though...
- infogulch 8y agoTorvalds just doesn't give a shit about appeal to authority arguments.
- simonbyrne 8y agoLinus has long railed against the aspects of the C standard, and how they're been interpreted by compiler writers [0]. I'm not much of a C programmer, but the C aliasing rules are incredibly confusing, and seem to be interpreted differently by GCC and Clang. e.g. GCC allows type punning via unions[1], but Clang does not [2]. [0] https://www.cl.cam.ac.uk/~srk31/research/papers/kell17some-preprint.pdf https://www.cl.cam.ac.uk/~srk31/research/papers/kell17some-p... [1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Type-punning https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Typ... [2] https://bugs.llvm.org/show_bug.cgi?id=31928 https://bugs.llvm.org/show_bug.cgi?id=31928
- ajross 8y agoThat was just a clang bug, and as I read the comments they fixed it quietly without exactly admitting as much. That kind of local bitsmithery on floating point values is a pervasive idiom, clearly explained by the syntax of the language, and the compiler had no business getting smart with it.
- flamedoge 8y agounion and memcpy are known ways to do type-punning. Caveat to these is that they require at least one memory copy operation. Last I heard, clang and llvm's TBAA is still buggy.
- deleted 8y ago[deleted]
- twoodfin 8y agoAnd he committed the patch anyway... https://lkml.org/lkml/2018/6/5/774 https://lkml.org/lkml/2018/6/5/774
- s-shellfish 8y agoIt's a reasonable response, imho. The community wants to go in a given direction based on directed guidance, a standard. The community that follows the standard blindly lacks the intellectual tools to question the standard. The community needs the standard at the present moment but also needs directed guidance to be able to learn how to question the standard. It doesn't seem like hypocrisy to me, it just seems like he's annoyed at the general problem, aware that an individual mind does not have the capacity to solve the problem alone, aware that a collaborative effort is needed, and otherwise, venting, because problems like these are honestly, incredibly frustrating, especially when computers basically have to all be able to 'think' in ways that are more or less, equivalent, yet, humans don't think perfectly identically.
- gkya 8y ago> The community that follows the standard blindly lacks the intellectual tools to question the standard. Yeah Linus is the sole person who has some "intellectual tools" in a community of thousands of people.
- s-shellfish 8y agoThat's not what I said.
- freedomben 8y agoThis is actually something I like about Linus, and one of the reasons I think the Linux kernel has been so successful: he merges stuff even when he doesn't personally agree with it or see the value in it. He has rejected plenty of stuff that would introduce problems, but despite the outwardly harsh attitude he works to try and make things acceptable so they can be merged.
- mark-r 8y agoIs there any part of the standards process that is geared to the needs of the users of the compiler? Or is it all determined by the compiler writers themselves? I'm wondering why this kind of push back is necessary.
- hshehehjdjdjd 8y agoThe people on the standards committee, at least for C++, tend to be heavy users of the language.
- Gibbon1 8y agoMy theory is there ware two kinds of programs. Type one: where all the side effects are hidden behind an OS call. Type two: Where side effects are primary and unavoidable. People on the standards committee universally write type one code (compilers and the like). Where the Linux kernel is type two.
- allengeorge 8y agoSo much swearing to make three points: 1. What's in practice conflicts with what the standard prescribes 2. The reason it conflicts is because the standard is misguided and everyone knows that; for reliable code-generation you have to take the approach in the kernel 3. He disagrees with the rationale for the change, and wants a better reason for it
- cowpig 8y agoI would add 4. As a general rule, appealing to a standard isn't a sufficient rationale for making a change. (I think most of the swearing was about that)
- thothamon 8y agoI guess you're right that Linus was saying that -- after all, he considers the standard to be less important than toilet paper. Regardless, if standards should be questioned, then surely Linus also should be questioned. I think a better rule would be: Appealing to the standard is sufficient reason for a change, unless a good argument can be made that the standard is BS.
- Gibbon1 8y agoyeah but strict type aliasing bro...
- icelancer 8y ago"So much swearing..." Yes, yes, that's Linus. Most of us have learned to get past that.
- dragontamer 8y ago> Most of us have learned to get past that. Have we really? The post is over 100+ points right now. People seem to LIKE this swearing thing Linus does. I don't think its healthy for the general programming community. The tone that was written here is certainly not acceptable behavior on YCombinator in general. But we put up with Linus because... well... Linus is an elevated programmer and we all respect him. For better or for worse.
- chomp 8y agoCommit in question: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=dp-4.18-rc1&id=63dcc7090137a893322432e156d66be3ce104615 https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux...
- tptacek 8y agoHe's probably right, but he expresses his ideas so poorly that he turns straightforward points into drama, I think intentionally. He doesn't just not give a shit about standards (probably healthy), but also what any of his audience thinks about his ideas (probably not so much). At this point, his flailing supposed anger is really just schtick. He deploys it so casually you just assume it isn't serious. Ironically, he could convey his contempt for standards, or for people who adhere to them slavishly, far more effectively if he simply wrote in a civil tone, rather than continuing to try to affect his Andrew Dice Clay of Programming persona.
- thereare5lights 8y agoIt is ironic that his own arguments about the standards can be applied to his own attempts to convey ideas, persuade other people, and collaborate effectively with other human beings.
- s-shellfish 8y agoIt's not really ironic, computers and programs are different from ideas and minds. His complaint is about computation and maintaining uniformity in computational philosophy, which is meant to allow development to flow with the least performance issues possible. Ideas can be impassioned, wrong, clever, ridiculous, circular, etc. Computation shouldn't be, but often is, because, preference. It's hard to hold all that stuff in one's head alone, and consistently feel like every time a problem is solved, a new one magically gets created, without having anyone to talk to, that really 'gets it', without that person pushing every single button you have about preference in computation.
- thereare5lights 8y agoYou missed the point. He is haranguing about ignoring reality, all the while ignoring the reality of how to effectively work in groups. His method of interacting with people is an idiotic way of doing that and he damn well knows that and just doesn't give a fuck and yet he wants to hold others to that standard in other areas.
- thelastidiot 8y agoHe is so full of it. It wouldn't hurt to say it nicely in 3 sentences.
- dragontamer 8y agoI find it ironic in that C++ has the correct solution to this problem. If you need type-pruning, use reinterpret_cast<foo>(bar). Done and done. Ironic, because Linus's weapon of choice (C... or more specifically, GCC's particular implementation of C) would require far more expertise to use correctly. Lets break it down. In C, type-punning is NOT part of the language. Its technically "undefined behavior". There's an expectation that when you do: short foo[2] = {1, 2} ; *(int*)foo = 0x12345678; assert(foo[0] == 0x5678 && foo[1] == 0x1234); A little-endian machine will pass this assert. But this isn't guaranteed by the C standard! This is "undefined behavior". The C-standard allows a C compiler to assume that foo[0] and foo[1] are still == to 1 and 2 respectively. Which would cause the assert to fail. In GCC -O2 or -O3, this may happen, depending on how registers get mapped to the variables. (The canonical memory location changes, but should registers be updated when optimizations are enabled??) When an optimizer can assume, and when it can't assume, "aliasing" is very much an undefined behavior within the C language. ------------- In effect, Linus knows GCC inside and out. GCC guarantees that unions will ALWAYS work for this aliasing problem. But this requires knowledge above and beyond the C Standard. Linus may be "hating" and "criticizing" the standard in this case. And I guess there's certainly a gap. But the general expectation that everyone knows the intricacies of GCC to properly understand the kernel code is misplaced IMO, and goes back to "Angry Linus yells at random dev unnecessarily" territory for me. And instead of simply explaining this VERY simple fact (although super-obscure) that GCC makes unions safe against aliasing issues at the compiler level... Linus yells at the dev. Not fair IMO.
- bigcheesegs 8y agoDon't use reinterpret_cast for type-punning in c++, you'll end up with UB. You should instead use memcpy.
- pavanky 8y agoBefore anyone flips out, he actually merged the code: https://lkml.org/lkml/2018/6/5/774 https://lkml.org/lkml/2018/6/5/774 Side note: I've merged it, and it's going through my build tests, so it's really not that I hate the code. But I really find that kind of one-sided rationale that ignores reality unacceptable. And I find it dangerous, because it *sounds* so "obviously correct" to people who don't know any better. If you don't know that gcc explicitly says that you should use unions to do type punning to avoid aliasing issues, you might believe that union type punning is a bad thing from that commit message. So it's dangerously misleading, because lots of people have a dangerous reverence for paper over reality. In programming, "Appeal to Standards" should be considered a potential logical fallacy. Standards have their place, but they definitely have their caveats too.
- peterwwillis 8y ago> And I find it dangerous, because it sounds so "obviously correct" to people who don't know any better. > So it's dangerously misleading, because lots of people have a dangerous reverence for paper over reality. It's the same thing everywhere. You see it as "famous person said X" or "the standard is X" or "the industry does X" or "X is popular". Then you talk shit about X, because you actually know it's not right, and people dump on you because you're a heretic, or not famous, or not an authority, or don't have "a piece of paper" to quote from. Everybody just goes with what sounds right rather than what is proven right.
- simplify 8y agoThere is not much in life that can be proven correct, and even less so in ancient past, which explains why humans are naturally this way.
- zzzcpan 8y agoTrying to appeal emotionally is just cheap and easy for our brains. Explaining things in depth and coming up with rationales is hard work.
- busterarm 8y ago
- devnonymous 8y agoI read the comments here before I read the post and was honestly expecting a full out swear fest. Instead, I read linus being passionately expressive about something he clearly has strong opinions about... With a few swear words and over exaggerated metaphors thrown in. I'm not saying that the language is not not-nice but it's not like he was being a bully or arsehole to someone in particular nor was he being over the top abusive. The delivery shouldn't be the take away here.
- digi_owl 8y agoReading it fully and it seems to line up with Torvalds attitudes towards things like userspace facing API stability. Standards are standards, reality is reality, and when the two conflict the only way to maintain long term sanity is for the standard to be amended to fit reality. The alternative is seen up and down userspace, where we have piles upon piles of workarounds, and whatsnot, to deal with APIs that change and break between releases because someone suddenly decided to re-read a standard spec like the devil reads the bible.
- camgunz 8y agoStrict aliasing shouldn't have been set as the default [1]. It was a huge mistake that instantly broke maybe all C programs everywhere. The standard also provided no guidance on how to work around the problem. `memcpy` is insufficient because it's a copy and that's a huge performance issue. Swapping through unions is UB. Casting about through `void * ` and `char * ` is gross, dangerous, and often runs afoul of alignment problems. It's a mess, and it has been for 20 years. Linus is right to be pissed. [1]: https://blog.regehr.org/archives/1307 https://blog.regehr.org/archives/1307
- tedunangst 8y agomemcpy(&int, &float) probably turns into the same register move as a cast. Check with your compiler.
- camgunz 8y agoYeah that's ok, but I don't know about arrays, or the "inheritance" pattern: struct Person { char *name; unsigned char age; } struct Teacher { struct Person person; char *subject; } This kind of code is pretty common in C, and memcpy doesn't (can't) handle it. (also hey Ted I'm a huge fan of your work, thanks in particular for threading, holy shit)
- FartyMcFarter 8y ago> `memcpy` is insufficient because it's a copy and that's a huge performance issue. Compilers (at least clang and gcc) are smart enough to see through those memcpy's. For example: https://godbolt.org/g/5L5PT5 https://godbolt.org/g/5L5PT5
- AnIdiotOnTheNet 8y agoMaybe, but wouldn't you rather be explicit so you know the compiler will do what you want instead of crossing your fingers and hoping it does?
- camgunz 8y ago
- HumanDrivenDev 8y agoI'm glad Linus still talks like this. Not because I find swearing charming, but because it turns off a certain kind of programmer. The passive-aggressive, post-flagging, code-of-conduct writer who has now become so prevalent and seeks to dominate so much of our discourse. I'd much rather deal with an straight-forward flamer than a milquetoast, down-voting circle-jerker.
- davesque 8y agoHonestly, I read a few sentences, began stumbling over the expletives, then decided I didn't care what the issue was or what his opinion is. Though he acts like everything that isn't done precisely as he would have done it in hindsight is "utter garbage", there are probably all kinds of historical and logistical reasons that things were done a certain way and that doesn't make the people involved "f*cking morons." And, to save everyone the trouble, the usual refrain of "he's actually right" is meaningless to me.
- gkya 8y agoWell the guy is just full of himself, and the community around him continues on to fill him up with himself every day. On other news *BSDs are mature, nice OSes with nicer communities around them (even De Raadt is better than Linus). Unfortunately I don't have time to try FreeBSD again to see if I can get suspend/resume working. But if I used a desktop I wouldn't think one bit and go with it.
- 2trill2spill 8y ago>Unfortunately I don't have time to try FreeBSD again to see if I can get suspend/resume working. But if I used a desktop I wouldn't think one bit and go with it. Suspend and Resume mostly work for me with the new drm-next-kmod drivers on an XPS-13 running FreeBSD current, it's just a little slow sometimes[1]. [1]: https://www.freshports.org/graphics/drm-next-kmod https://www.freshports.org/graphics/drm-next-kmod
- gkya 8y agoThanks, made note of this!
- buserror 8y agoGive him a break, megacorps are making billions on top of his software, and he's not. I'd be swearing all day as well! ;-)
- busterarm 8y agoI can't imagine what it's like to be in Linus' position. After all these years he still hasn't found Linux's own Junio Hamano to turn over maintainer-ship to.
- jaequery 8y agothere is nothing new here.
- alexandercrohde 8y agoI wonder if there's a way to put all this engineering thought into reducing/simplifying standards and optimizing compilers so that individuals don't need a Linus-level knowledge. In my opinion, the knowledge-cost of a system is a major downside that is often ignored (probably the biggest downside of unix, vi, git).
- AceyMan 8y agoEvery time I've gotten sucked into these <cough> notable LKML messages from Linus I'm not taken aback in the least. To my ear, his language comes across as that of a drill sergeant: intentionally loud, pejorative, and foul for reasons of effectiveness, in addition to reinforcing the hierarchy he sits atop (as do the tirades of any prototypical drill sergeant). My 0,02$. NB: my parent cussed like a sailor, certainly influencing my PoV.
- yedawg 8y agoRoasting other developers for getting it wrong is so much worse than just saying "the standard doesn't apply here. Try this instead"
- Bromskloss 8y agoI would rather that he made a standard wherein he specifies how he thinks the language should behave, and then followed that standard slavishly. One must follow _some_ standard slavishly!
- olds009 8y agomy credit score was below 500 before I met swifthackgenius, I had a lot of issues getting a loan based of my credit, when I wanted to get a loan at the Metro Union, they told me to pay back my debt first, when I asked for my credit report from the bureaus, I realized I have 7 hard collections and 5 inquires on my credit, I wanted to get my house and I needed help, I was searching on the blogs when I met swifthackgenius gmail dot com, he told me about the necessary process, he also got rid of the debts on my credit and raised credit score to 830. now I have my house back and I'm out of debt. You can contact him 256 743 0587 and he will be ready to assist You. I hope this helps.
- r33fer-hax 8y agoagred