150 points · by r4um · 8y ago · 269 comments
He also does no service to his own arguments by peppering them with childish swearing because things like "So standards are not some kind of holy book that has to be revered. Standards too need to be questioned." can't be said enough to some people in the industry.
If his reply were written with more tact and less swearing it would be a lot more powerful. We as an industry should demand this of each other, but also of our 'celebrity' colleagues.
As a northern European I find it not only comfortable that Linus runs Linux, but I would be less comfortable if it was another American smile in face pretend to be your friend but be shady as fuck attitude that you guys seem to confuse for 'professionalism'.
So let's chalk this to cultural differences. We wouldn't hire someone like you and you wouldn't hire someone like him.
I never said that Linus should be fake friendly. I am saying that swearing does damage to moral and the power of his arguments.
Also, Steve Jobs was a notorious asshole and he is revered in the US despite this. There are countless other examples of CEOs and managers who are more than unfriendly in the US who are looked at as examples of how one should behave to be 'professional'.
Your being 'northern European' has nothing to do with any of what we are talking about. Maybe you can chalk your reaction to your apparent false sense of superiority over friendliness and, it seems, Americans.
Tact can be very usefull in small teams where trust and coordination is important.
For large projects, with thousands of stake holders the bar to participate in a conversation should be high.
As we both say in Holland: we are not made of sugar. But go read Linus rant now and ask yourself: would this really classify as an inappropriate rant in Holland? Or are you just, parroting the default (mostly from the US) critique on Linus?
Because this whole 'Linus isn't tactfull' is a false comparision. He is more approachable than any other person in that sort of position. Since there isn't a big filter at the door based on who somebody is but there is a verbal filter at the table. Very egalitarian if you ask me. Very Dutch like.
And our directness is often referred to as rude. It would look better on you to not blindly follow in that judgement when it concerns others.
For example: >Maybe you can chalk your reaction to your apparent false sense of superiority over friendliness and, it seems, Americans
If out of the mouth of Linus would be one of those 'look at how insensitive Linus is' posts. Something with the pot and the kettle.
This is a false dichotomy.
Most of what Linus says would run foul of HN's guidelines - which I'll paraphrase here as "don't call someone an asshole before making your real point", but that doesn't mean that everyone on HN is a 'smile in face pretend to be your friend but be shady as fuck'.
Keep in mind that you're much more likely to see it when he explodes at someone, because that's more entertaining to read. Most of what he writes in the ordinary work of building a kernel is unobjectionable.
I doubt there is difference between about how often people resent other people around the world. But I do consider it more humane if resentment isn't hidden under the surface. It's easier to trust Linus than a tactfull politician. That should make us all think.
That being said, I feel that if I were in a managerial position here in the Bay Area I would probably adopt a smile and softer language because that's what people are used to. The challenge is being genuine while putting people at ease so that they can do their best work.
"Why did you cook this? Are you fucking stupid?"
I'm in the military, and if you can't control what you say, you shouldn't be respected.
In the military with all the hierarchy this wouldn't happen because no small private would be arrogant enough to throw their opinion in the top generals and president face without being asked.
The whole point of the rudeness is that it does give space for people to voice their opinion irregardless of their rank. Only at the risk of being somewhat insulted.
I don't care that Linus swears, he hasn't invaded anyone or harmed anyone as far as I know. I don't care that Trump swears, I care about the stupid stuff he actually does.
Linus may swear, but he also protects us from bad code and I value that, because in the end, words don't do anything, actions do.
Yes, there are cultural differences between the US and Europe.
No, that doesn't mean that Europe agrees with your opinion on what constitutes acceptable behaviour in the software community. You do not speak for us.
It's quite refreshing, even.
I'm just asking this to see if this culture is one way or goes both ways...
The honest reaction to any post like this is to just report it because the only entertainment factor is the drama.
That won't tell you anything about LKML culture, either.
If you want a better sense of lkml than social media hot takes can deliver, go lurk it for a month.
He never needed any protection; Linus always wrote like this. Back in the argument with Tanenbaum in '92, when he was a nobody, he already wrote stuff like "your job is being a professor and researcher: That's one hell of a good excuse for some of the brain-damages of minix. I can only hope (and assume) that Amoeba doesn't suck like minix does."
https://mobile.linuxtoday.com/security/minix-the-most-popula...
His idea is that he wants to make his feelings as clear as possible. He mentioned a case where some guy attempted suicide after working months on a kernel patch that he rejected. He blames himself for not being clear enough about what he felt about the idea before work has started.
When you say "People put time and energy in making software better, at least in their own eyes, for others and then they get textually abused". That's actually the whole point. Linus doesn't want you to put time and energy in what he perceives as a lost cause.
Not saying that what he does is good or bad, just saying what I think his rationale for using harsh language is.
I don't know if that's good or not, but it's not just in software that harsh words are used. And their stridency makes clear that this is an exceptionally significant point. I imagine that Linus's many more blandly worded emails don't result in this level of attention, so you wouldn't even be aware of his points there.
In this case, Torvalds is swearing at someone who agrees with him (see Andy Shevchenko's response) because he hasn't bothered to seek clarification before calling it "pure and utter garbage".
Yeah, there were few reasons why I decide to make that patch (OK, it seems I staked on not the best reason)."we're fucked" <-- feared consequence
"You are fucking us up!" <-- your actions are harming the group.
Not "you are a fuck" and no shunning from the group.
I don't care for the tone, and all the dark patterns could be there too in the meeting, but your single quote on its own is not evidence of dysfunction.
You shouldn't sell yourself short. Changing the way you communicate is a huge but worthwhile challenge.
In a different time, I would have been mean to you over your comment instead of offering supportive words. It took as much effort to be nice as it used to take to be mean.
'Hey, great that you took the time to contribute, here are a few suggestions though.'
I am talking about things like: 'If you think xyz, then you are a fucking moron'.
The constructive part, not destructive, is in the alternatives proposed. So, plus minus zero in my mind, the emotional aspect is just a grab for attention, and ...
Sometimes people forget that C was created for writing operating systems. They get in their mind that C is all about high-performance, and that making it competitive with FORTRAN is the way to go. I understand that, but it's not what C was created for. If the world's most famous C programmer and OS guru wants to have strong opinions on the direction of the language, I say allow it.
That doesn't properly justify C's minefield around aliasing and type punning in general. It's UB galore. Thing is, whenever you're writing low level code that's tied to hardware in my experience you very often end up having to pun your types to match hardware constraints, and at this point the C standard basically says "lol good luck with that bro".
I'm not a programming language expert but IMO at the very least C should make reading from a different union member than was last written to "implementation defined" instead of UB (with suitable constraints if the sizes of the members differ I suppose). In effect that's mostly how compilers deal with that anyway.
So I agree with Linus that the C standard is really unhelpful in these situation, although his childish anger is unnecessary and counter-productive.
"If the member used to access the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called "type punning")."
The whole world needs betrization soonest ( https://en.wikipedia.org/wiki/Return_from_the_Stars )
That's how it is :) The standard even describes union behavior as "type punning".
I don't know if C++ allows it though.
union { int i; float f; } u;
You can't safely call a function with pointers to the members like func(&u.i, &u.f), because when func was compiled, the compiler couldn't know that the arguments are pointers to union members.
This sort of thing scares me, because what the compiler can "see" isn't well defined. Is it ok if func is in the same file? Probably not. How about if I don't send the pointers to an other function and just use them locally? Probably ok, but I wouldn't trust it. If you want to type pun with a union, make sure to always access the members through the union, not with direct pointers.
The only method of type punning I 100% trust is memcpy, and if you get lucky the compiler might optimize away the overhead for you.
If the C standard says: the following construct is undefined, then as a compiler writer you have two options: you try to figure out what is sensible in this context, or you do something crazy that conforms to a literal interpretation.
For operating system code, you want the compiler to something sensible. Life is already hard enough. In just about all cases where the C standard introduces undefined behaviour, there is an obvious interpretation that makes sense to most C programmers.
If you want to get the highest possible score in a benchmark, you write a compiler that drops code left and right if you can prove that the code invoked undefined behaviour.
Unfortunately, compiler writers, in particular the maintainers of gcc, seem to care more about this ratrace than to write a good compiler for compiling operating system code.
Not exactly. Rather, the compiler is not constrained by any particular behavior of the construct which is said to be undefined. So if there is an optimization that changes the meaning of the undefined construct, it's all fair game, because the construct was not defined in the first place.
That's only useful if you only care about the total run time of the program and not about what it is trying to achieve.
I think it'd be helpful to be able to talk about this behaviour without needing to suger-coat it as "opinions".
There are far less damaging ways to say exactly the same things as Tovalds says, and someone with his position in the community should know better.
Punch up if you like, not down.
[1] It's an open secret that most of the optimizations introduced in the last ten years provide no real benefit while making programs harder to reason about and trust. While at the same time the gcc backend is a trashfire. Hint, Microsoft's VC compiler produces better assembly code without any of these 'optimizations'
I don't see why it would need to be negative emotion sourced from another area of his life that is leaking out here.
You presumably have to be pretty emotionally invested in something to work on it that long as a hobby and only later as a job.
There's nothing wrong with this - it's an important enough project to be able to make those kinds of demands.
[1] https://lkml.org/lkml/2018/2/14/724 [2] https://lkml.org/lkml/2018/2/14/157
If Linus would habitually curse in the kernel list, it would have no emphasis effect and it would be a really bad style. Linus using cursing in a rant equals [for wider distribution] and it works perfectly. I can't remember a single discussion linked to HN that didn't start from cursing. It provided the opportunity for people to be offended. For technical people it's a challenge (like a glove slap).
Example:
* his opinion about hardening: https://lkml.org/lkml/2017/11/21/356
* previous message that collected the attention: "Those security people are f*cking morons." https://lkml.org/lkml/2017/11/17/767
this was the whole point of the rant.
He already writes that he's OK with the code ("can live with it") -- he's against the reasoning that accompanies it.
This is for history. If someone, later, say: "We should use union aliasing to fix this", someone would argue "No, we shouldn't because we already states _there_ that union aliasing is bad".
You can't consider a such amount of code like the kernel one without its commit history.
Here Linus explain why union aliasing is not "bad" per see, but considered "bad" because the C standard say so and he clearly explain standards are not holy book and compiler implementation is as important (something he always states).
Several, but no one that mattered enough with respect to Linux for his opinion to matter in return.
His OS, his rules. Others can always fork it if they have an issue with that.
It seems to have worked fine as a gatekeeping technique for the last 25+ years, even if it hurts some feelings. Linus goes for an in-the-trenches, rough camaraderie, approach, rather than a "professional soft spoken cubicle workers" approach.
He's an outright toxic and abusive person. Characterizing a lack of toxic, abusive behavior as "professional soft spoken cubicle workers approach" is disingenuous.
Yes.
Back in 2014 several DebConf attendees publicly confronted Torvalds, quoting some of the outrageous things he's written to/at people and making him explain himself. It makes for some rather cringy moments and there is no evidence it had any meaningful impact on him. You may watch it all here:
See excerpt here: https://twitter.com/nntaleb/status/892370148476190720
Linus Torvals adds some insults into the above or simple does not even attempts to keep control over his emotional side - half people jump up and down happy like a fourteen years old. Wow, look, he used insult! The other half suddenly turns into prude "I never swear nor insult anyone" Victorian aristocrats - despite having tweet feeds full of, and I am quoting here, "fucks".
> In fact, I'll take real toilet paper over standards any day, because at least that way I won't have splinters and ink up my arse.
An Englishman saying "that's interesting" can be more rude than someone else saying "get lost"
never disappoints.
double d = 3.14;
int64_t *p = (int64_t *) &d; // !!!
int64_t n = *p;
The union aliasing way would be to makeset the double field in a union and read the integer field back: typedef union {
double d;
int64_t n;
} int_or_double;
int_or_double u;
u.d = 3.14
int64_t n = u.n
According to the standard, the union aliasing approach is allowed, but the type punning one is undefined behavior.---------
The standard team decided to forbid type punning to allow compilers to implement more optimizations. They still allow union aliasing because they felt there should still be a way to do low-level type casts if for those that absolutely want to.
The standard only allows reading a value as the type it was written with or as char, and an access as char is only good for copying. If a char access used different bit order, that would be OK according to the standard because you couldn't tell unless you violated the standard.
It seems every compiler will tolerate a memcpy for type punning, even though this isn't required.
double d = 3.14;
uint64_t i;
memcpy(&i, &d, sizeof(d));
is perfectly kosher.That's why Linus writes:
"So the commit message that talks about how horrible union aliasing is is pushing a story that is simply wrong."
The commit message with which he disagreed obviously explicitly wrote something like (paraphrasing) "using union is undefined behavior by standard, so we are changing the code to not use it" etc.
Linus also wrote: "I'm not talking about the changes themselves - I can live with them. But the _rationale_ is pure and utter garbage, and dangerously so."
The rationale was (note, I don't have exact quote, I'm paraphrasing, if somebody has the original please give a link) that using unions for that is bad as per standard. Which is what the standard says but which is for practical purposes simply wrong. The standard is wrong an should not be followed, that was main Linus' argument.
IMO there are 4 highly relevant paragraphs in C99:
6.2.6.1: When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values.
6.2.6.1: When a value is stored in a member of an object of union type, the bytes of the object representation that do not correspond to that member but do correspond to other members take unspecified values
6.5.2.3 DR283) If the member used to access the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called "type punning").
6.7.2.1: A pointer to a union object, suitably converted, points to each of its members (or if a member is a bit-field, then to the unit in which it resides), and vice versa.
None of this implies that unions can't be used for type punning. What it does imply is that reading from a larger member of the union than you last wrote to will leave you with an unspecified value.
void wat(uint16_t *x, uint16_t *y) {
*x = *y;
}
uint64_t a[100] = { 0 };
wat((uint16_t *)&a[0], (uint16_t *)(((char *)&a[0]) + 1));
When you think you've figured that one out, try this one: uint16_t heh = 0xFFFF;
extern uint16_t doesAnything(uint16_t *, uint16_t *);
void wat(uint16_t *x, uint16_t *y) {
*x = *y + doesAnything(&heh, y);
}
uint64_t a[2] = { 0 };
wat((uint16_t *)&a[0], (uint16_t *)(((char *)&a[0]) + 1));Linus is obviously being harsh, his words are also preserved publicly as a part of the contribution. He's arguing against the logical fallacy. Had he not swore: would we discuss this?
These outbursts seem to happen every few weeks, and have long seized to surprise. IF anything actually bad ever comes up, he has no further escalation available to raise awareness.
It also reminds me of these choleric bosses screaming at someone every day: it's almost always a sign that they're insecure, sociopaths, or can't handle their responsibilities.
But I work in customer support of highly technical products, and I visit various companies very often. By now, I can figure this type of persons from the first communication -- not the ones who does it the way Linus does it (see above), but the real a&^%$%^$les -- owning some inner knowledge unavailable to others, just because they happened to be here from the bigbang and haven't evolved since. Boy, is this "rough but just and truthful" attitude counter-productive to projects! I haven't seen any exception to that yet.
Fork it and make your own.
Even Google couldn't pull that off with Android.
well, if you can keep pace with it, why not ?
"Spoiled little princesses" are those that can't take some strong words and need hugs and smiles...
#define BASE_FIELDS int a; int b; int c;
struct Base {
BASE_FIELDS
};
struct Derived1 {
BASE_FIELDS
int d; int e;
};
struct Derived2 {
BASE_FIELDS
int f; int g;
};
Then, it has lots of code that accesses Derived objects through a `Base*`, with ->a and so on.Is this against the standard C aliasing rules? If so, how would this need to be rewritten to conform to the standard?
edit: If you want to keep the existing syntax and can use GCC extensions, it should be legal to use an unnamed union:
struct Derived1 {
union {
struct Base base;
struct {
int a; int b; int c;
};
};
int d; int e;
};
edit2: or, with -fms-extensions, just struct Derived1 {
struct Base;
int d; int e;
};"One special guarantee is made in order to simplify the use of unions: if a union contains several structures that share a common initial sequence (see below), and if the union object currently contains one of these structures, it is permitted to inspect the common initial part of any of them anywhere that a declaration of the complete type of the union is visible. Two structures share a common initial sequence if corresponding members have compatible types (and, for bit-fields, the same widths) for a sequence of one or more initial members."
So Linus, made my day!
You can print the Standard on the real toilet paper and have the best of both worlds. Read before wipe!
Linux only took off thanks to SGI, IBM, HP, Cray seeing value reducing costs from their own in-house systems to something else.
Unless you're heavily invested in the Linux kernel and Linux-only tech, I'd advise to keep your software running on the BSDs as well as Linux to avoid monocultures in your own best interest. The strength of F/OSS is in giving you choice, eg. by providing two (or more) interchangeable, excellent O/S's and compiler suites.
"When documented gcc behavior says one thing, and the standard might be unclear, we really don't care one whit about the lack of clarity in some standard."
I think the union thing was at least initially implemented as not functioning at all in clang, where developers "followed the standard."
For modern compiler, just use memcpy and compiler can optimize away the memcpy and produce the exactly same code.
But the kernel developers has some issues on trusting compiler generated code.
If you have a better argument to counter his logic, please post that, it would be more useful for everyone involved. Posting pretty useless comments here is pretty lame.
I think most people couldn't care less who's right or wrong in this discussion. They are simply reacting to the discourse.
Personally, I'm far from convinced that there even is an objective right or wrong in this question. It's probably just a matter of taste and/or perspective.
I find Linus behavior rude because in discussions like this he seems to have little to no understanding of other perspectives than his own.
Either that or he is deliberately provoking this other fellow to get him off his high horses.
In either case, it's not exactly accepted public discourse.
He has said himself that he needs to do this to drive his point across, and given the medium and audience I can agree that the political challenge of running the project must be huge.
But surely there must be a more diplomatic way to the same end?
> Personally, I'm far from convinced that there even is an objective right or wrong in this question. It's probably just a matter of taste and/or perspective.
This is not always true. Sometimes there is only one correct/pragmatic way of doing something. And if someone asserts that it's nothing wrong.
> I find Linus behavior rude because in discussions like this he seems to have little to no understanding of other perspectives than his own.
You can't say this is the case always. I have read a lot of the discussions like these. A lot of times, he writes a pragmatic and valid explanation of his dislike about a certain topic.
> In either case, it's not exactly accepted public discourse.
Again, you are assuming all cultures and societies are alike, they are not. There is a vast wide world with different thinking and a culture other than the Silicon Valley bubble. It's time people stop generalizing everything under the sun.
Speech is a topic of discussion just like anything else under the sun.
(And also: People here have no authority or power to police anything.)
You can take as many steps as you want to get to the mailbox too. And you'll be taking more steps if you detour to go sniff dog shit. Going in a straight line solves two problems - it's faster and it smells better.
Reading on a shitty 96dpi 100nits screen from 2004 in a bright room, the lkml link is the more readable one.
Another situation of the eternal issue of "we need a web standard for specifying relative contrast", not "make everything blinding #000 on #fff".
With CSS4, you can choose other colour-spaces instead.
The web standard is there, but so long as 99% of users have setups which emit 300+cd/m^2 and say they're emitting 80, you can't do much with it.
The push toward HDR displays gives us another chance to 'get it right' wrt calibration, but a quick google search of 'HDR washed out' demonstrates why it's an uphill battle to get consumer displays to be honest.
Hell most displays nowadays don't even do sRGB, which was defined as the colorspace and contrast of an average 1990 CRT.
Oh wait, you know you can switch CSS to default layout? Perhaps the browser could use an option to still apply layout but ignore formatting and colours.
I really wish browsers' default formatting could be trusted to be as readable as possible, but alas.
a) useless- doesn't change anything b) the publicity is affecting the other side more
So basically Linus is Trump