Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tom_mellior
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
tom_mellior
5y ago
It hurts my eyes to see the author consistently misspell "automaton" as "automation".
32.
▲
by
tom_mellior
5y ago
"Be nice to each other" is preached by every other world religion, as well as being at the center of many non-religious world views. The fact that we can and should be nice to each other to make the world a better place can hardly
33.
▲
by
tom_mellior
5y ago
Interesting, thanks. It's true that "hot takes" of the form "X is Y" become a bit more difficult without the copula. Not sure how much we win by saying "A dictator rules Russia" vs. "Russia is ruled b
34.
▲
by
tom_mellior
5y ago
Something about this website takes my machine to 500% CPU load (Firefox/Linux). Good thing we will get 2048 cores soon...
35.
▲
by
tom_mellior
5y ago
You're right that there is a well-established term "Southeast Europe" to refer to the countries you mention: https://en.wikipedia.org/wiki/Southeast_Europe But there is also the fact that Europe continue
36.
▲
by
tom_mellior
5y ago
What about "to be" shows thinking that needs unmuddying? Why should we consider sentences like "the cat is an animal" or "the cat is furry" problematic?
37.
▲
by
tom_mellior
5y ago
What knowledge would that be? At least in these Catholicism-dominated parts, that knowledge seems to look something like "you better watch it because you're a sinner and might end up burning in hell, except that Jesus saved you be
38.
▲
by
tom_mellior
5y ago
> This causes an interesting problem: how do we switch to the optimised version? JITs don't bother switching calls which are already running Many JITs can do this. This is called "on-stack replacement" (OSR).
39.
▲
by
tom_mellior
5y ago
OMG yes. The "gate" in its name is really apt. ResearchGate adds zero value but non-zero barriers to access.
40.
▲
by
tom_mellior
5y ago
Ha! This is an excellent take. Maybe minus the "limited edition" part, since whoever minted the NFT can just mint the same one again. Even if they claimed they wouldn't.
41.
▲
by
tom_mellior
5y ago
I have a sit/stand desk that I bought expecting to stand the first half of the day, then sit the second half. On the very first day I forgot to ever sit down, and I've been 100% standing ever since. I stand on a rubber mat thing w
42.
▲
New Coronavirus Detected in Patients at Malaysian Hospital; Source May Be Dogs
(npr.org)
5 points
by
tom_mellior
5y ago
|
0 comments
43.
▲
by
tom_mellior
5y ago
> A lot of C optimization could work that way - relying on cooperation between the compiler and programmers. That is precisely how it works already . The reason your code has no bounds checks is exactly because the compiler can assume
44.
▲
by
tom_mellior
5y ago
So on the one hand you're (rightly) saying that this function has no semantics under the rules of the C language, but on the other hand you're saying that the semantics that C compilers assign to it is a bug, and on the third hand
45.
▲
by
tom_mellior
5y ago
Nice. If you like, could you explain again what the perceived difference is to adding if (offset >= INT_MAX - 16) fail(); in foo()? (I mean, besides the fact that the size of the buffer pointed to by arr is highly unlikely to ag
46.
▲
by
tom_mellior
5y ago
>> an uninitialized y is an actual uninitialized register or memory location. > On typical hardware, yes. Maybe you can help me identify the register or memory location for y in your example: https://gcc.godbolt.org/
47.
▲
by
tom_mellior
5y ago
But you're not using the offset to compute the index in bar(). void foo(int offset, int *arr) { for(int i = offset; i < (offset + 16); i++) { arr[i] = i + 32; } } If you call this with offset
48.
▲
by
tom_mellior
5y ago
> This is permissible (on typical hardware) Hardware doesn't define C semantics. C defines C semantics. I don't understand what your conditional example is trying to say, but you seem to assume that an uninitialized y is an act
49.
▲
by
tom_mellior
5y ago
You changed writes to indices offset..offset+15 to writes to indices 0..15.
50.
▲
by
tom_mellior
5y ago
Yes, with lots of extra ceremony around it. (More than is needed, since it doesn't seem to realize that it will always process exactly 16 loop iterations.) Since you've posted a lot along the lines of "these optimizations don
51.
▲
by
tom_mellior
5y ago
I think you are misunderstanding the situation. Given code like: if (!p) { use(*p); } (given no previous knowledge about p) no compiler will remove the "if (!p)" part. What people are complaining about is the
52.
▲
by
tom_mellior
5y ago
Could you post a complete example please and tell us which compiler optimizes out this check? Clang and GCC don't: https://gcc.godbolt.org/z/dbTadEcra
53.
▲
by
tom_mellior
5y ago
In all of the examples above it will emit a machine instruction to dereference p. What your grandparent is complaining about is that it will later remove an "if (!p)" test.
54.
▲
by
tom_mellior
5y ago
> The trouble was that in that context, a null pointer dereference didn't trap, (because it was kernel code? not sure.) so the bug was not detected. Yes, because it was kernel code. Because that dereference is completely legal in ke
55.
▲
by
tom_mellior
5y ago
> The proper way for a compiler to handle this, would be to add a single overflow check before the loop, which branches to a scalar translation of the loop. Most realistic code will need a scalar version anyway, to deal with the prolog&#
56.
▲
by
tom_mellior
5y ago
This was in the Linux kernel, which is compiled with special kernel flags which make dereferencing null pointers legal. In the context of that code, dereferencing a pointer and later checking it for null was absoutely meaningful. Optimizing
57.
▲
by
tom_mellior
5y ago
If you want pragmatism, check whether something is legal before you do it.
58.
▲
by
tom_mellior
5y ago
The world doesn't end, but in the "int" case you get nice vector code and in the "unsigned int" case you get much less nice scalar code: https://gcc.godbolt.org/z/cje6naYP4
59.
▲
by
tom_mellior
5y ago
> In my mind it's 100% not okay to (by default) optimize away a check for integer overflow. But a + 100 > a is not a check for overflow. If a >= INT_MAX - 100, it is an overflow. The "will this operation overflow"
60.
▲
by
tom_mellior
5y ago
I'm not convinced. The argument seems to hinge to a very large extent on the sentence: > Permissible undefined behavior ranges from A, to B, to C. The observation that "Permissible" has a specific meaning is important and
More ›