“It is never a compiler error”
51–60 of 280 posts
Re: “It is never a compiler error”
#52In 10 years, I've seen 3 compiler bugs. That's just enough to leave the door cracked open for "y'know, it could be a compiler bug..."
Re: “It is never a compiler error”
#53 // but it should have been:
if (changes == 0) break;
While this fixes the problem, it no longer handles the case where count is negative. Yes, in this function it's likely that "this never happens", but it's generally good practice assume as little as possible. // still stops on negative values
if (changes
or if negative values could indicate some kind of serious problem: // first trap problems
if (changes Re: “It is never a compiler error”
#54Earlier quoted context omitted.
I think we need to get away from this attitude, that I used to hold, that O() is everything. It isn't. It isn't even close. We should instead wonder why an algorithm was chosen without regard for the nature of the data on which it will be applied. For sorting O(n lg n) only makes sense as a selection criteria if you have absolutely no idea about what data is being sorted. Why is that? If the answer is you just don't…
Hu. Bubble Sort. And not only that; a buggy version! And if you believe sequential access is gonna save you from O()... you're so wrong its not even funny. Of course the curves will cross latter. But they will cross. Especially on a sort.
Re: “It is never a compiler error”
#55Re: “It is never a compiler error”
#56Sadly, I've lost count of how many compiler bugs I've tripped over through the years. Often it's compiler crashes -- those are usually easy to get fixed, especially when (as tends to be the case with LLVM) they are caused by assertions failing -- but I've also tripped over compiler hangs (there's a variable in the tarsnap code with an utterly bogus volatile specifier in order to avoid the problematic optimization on…
Re: “It is never a compiler error”
#57I've hit dozens or hundreds of these, across many languages for decades.
It's not the first thing to check, but once you verify the code is logically correct, that can be the only conclusion.
Compilers aren't excessively complex code, but all code has bugs.
Re: “It is never a compiler error”
#58> [5, 4, 5, 1].sort().join('')
> "1455"
Re: “It is never a compiler error”
#59I don't understand the env in which this happened, because cracking open my console, I get > [5, 4, 5, 1].sort().join('') > "1455"
See the pull request here https://github.com/code-dot-org/JS-Interpreter/pull/23