Linus Torvalds on aliasing
111–120 of 284 posts
Re: Linus Torvalds on aliasing
#112Notice that after his rant, he still tested the code, and merged it: https://lkml.org/lkml/2018/6/5/774
Did he get some follow up from the author of the changes?
Re: Linus Torvalds on aliasing
#113Earlier quoted context omitted.
I'll critique his prose on efficiency grounds. He wastes many words making a point.
Let's stop policing speech, alright? You can use as many words as you want to express your views. I personally would not use the same words he might use, but let's not be hypocrites and say that none of us have written an angry or frustrated response to something that we think is stupid and just plain wrong.
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.)
Re: Linus Torvalds on aliasing
#114To me, this rant seems more directed at C standards people than the guy he sent it to. That doesn't excuse his vitriol, but I hope people will read between the lines. 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.…
>C was created for writing operating systems 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 l…
The whole world needs betrization soonest ( https://en.wikipedia.org/wiki/Return_from_the_Stars )
Re: Linus Torvalds on aliasing
#115Re: Linus Torvalds on aliasing
#116Earlier quoted context omitted.
Clang was made to support GCC extensions and be as close to a drop-in replacement for GCC as possible. Linux misses support for MSVC, Intel C Compiler, XL C and basically every other C Compiler ever written except for these 2.
Clang doesn't support every GCC extension, though. For example, nested functions is something that it doesn't do.
Nested functions is exactly how you would write it in assembly.
Does anyone know why clang won't support them? "Blocks" are fucking stupid.
Re: Linus Torvalds on aliasing
#117To me, this rant seems more directed at C standards people than the guy he sent it to. That doesn't excuse his vitriol, but I hope people will read between the lines. 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 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.
Re: Linus Torvalds on aliasing
#118Here is a slightly more readable version that's not white-on-white, half-pixel-thick text: https://lkml.org/lkml/2018/6/5/769
Reading on a 400dpi 300nits screen in a slightly dark room, the lkml link hurts the eyes significantly more. 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.
Re: Linus Torvalds on aliasing
#119He 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.
Re: Linus Torvalds on aliasing
#120Doesn't C have something better than that type punning via union to achieve the same effect? I understand Linus reasoning, but still it's an ugly hack.
Type punning to char* is explicitly allowed. (But going from char* to any other type is not...)