1,205 karma · joined Jan 2, 2022 (4y ago) · 235 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
2) There's no such thing as a "finite symbol." What does that even mean? A symbol is a symbol, it symbolizes something. The symbols themselves are finite; they're just letters. But if that something that it symbolizes is an infinite quantity, why stop it?
You are living too close to reality and numbers and words. Even if sets were rigidly defined as finite objects, why not define some new thing, call it an "infinite collection," and let all the theorems like countability and aleph-null come out of that? It lets us do useful math, after all, so why let the words we use stop us? Clearly set theorists worldwide find nothing* wrong with the current definition.
comment 3y ago · link · parent
comment 3y ago · link · parent
Do they even understand the words coming out on the page? I'm sorry but if people can't afford to clothe themselves then fuck the "local textile industry," aka forcing people to spend money on clothes they probably cannot afford. Wearing shoes should be a human right (God knows there's probably enough shoes for everyone on Earth) and saying we should stop sending second-hand clothes to places for the purposes of job creation is just breaking windows to make jobs for window repairmen.
comment 3y ago · link · parent
comment 3y ago · link · parent
if let V6(sock6) = addr {
// use sock6: SocketAddrV6
}
The first-linked duplicate answer will answer your question: https://stackoverflow.com/questions/9109872/how-do-you-acces...comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Not that I'm saying it's not impressive, but it does come with some implications for the future: first, I don't think there's any way the output can even get better at all. There's too much bad writing out there, and it's too hard to differentiate it from good writing. ChatGPT is trained on I guess the entire Internet, which of course includes terabytes of poorly-written blogspam and bad marketing copy. And if AIs like ChatGPT really have some practical purpose, and if they really are the future of, say, technical writing, or writing on the Internet, are we destined to read shitty blogspam forever? Will everyone's writing become lame and highschoolery and robotic? Or will being able to write in a more interesting way become yet another key indicator of humanity and sincerity that we look out for?
comment 3y ago · link · parent
comment 3y ago · link · parent
The truth is that practice diverges from theory, and, in practice, it is actually useful to talk about UB as a thing that happens and not as some mystical aura the compiler can sense or not. Leading to, in practice, almost all of these points being, if not flat-out wrong, at least unhelpful or misleading to the average programmer. For example:
> 14. Okay, but if the line with UB is unreachable (dead) code, then it's as if the UB wasn't there.[1]
The linked post ([1]) doesn't even showcase this phenomenon, it shows something completely different, where ignoring a 3 transmuted into a bool causes more UB. The problem was that you already had UB to begin with when transmuting a 3 into a bool. I want to see a godbolt output where the claimed:
if (false) {
run_ub();
}
actually causes problems.> 28. At least it won't completely wipe the drive.[2]
This is just unhelpful for anyone trying to learn more about UB. UB can call parts of your code that would otherwise be dead, which is a useful piece of information to know. And if you literally write "rm -rf /" in these dead sections, then yeah, I guess UB is technically wiping your drive, but stating it like that just gets in the way of anyone trying to learn more about UB and just perpetrates this unhelpful theory that UB can literally do anything it wants, such as...
> 30. At least it won't start playing Doom if the program didn't already have the Doom source code in it.
Really?
> 31-32. If a UB-containing program "worked fine" previously, recompiling the program without any code changes will still produce a binary that "works fine." Recompiling without code changes and with the same compiler and flags will produce a binary that still "works fine." Recompiling as above + on the same machine will produce a binary that still "works fine."
In practice, compilers are generally deterministic. I see no reason this should be the case. Don't link me a sadistic compiler that randomizes code output.
Finally,
> The moment your program contains UB, all bets are off.
is blatantly untrue. All guarantees are off, but I can bet what most programs with UB do, and it is still useful to be able to reason about what programs with UB do. For example, I can tell you what:
int main(int argc, char \*argv) {
int *p = NULL;
*p = 4;
}
does on O0 on my machine, and most linux machines, despite the fact that it is untrue for "Any kind of reasonable or unreasonable behavior happening with any consistency or any guarantee of any sort."You guys are engineers right? Software engineers? Why don't you do what all engineers are supposed to do and that is use experience and intuition to know when theory applies in practice, and when it doesn't?
[1]: https://www.ralfj.de/blog/2020/07/15/unused-data.html
[2]: https://kristerw.blogspot.com/2017/09/why-undefined-behavior...
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
What a nasty comment from an otherwise fine article. A reply is not an endorsement, and not even linking the tweets in question really lets the author hide the evidence and twist the paragraph into whatever he wants it to mean. Besides, it's not like Justin Trudeau is lacking on things to attack him for.