Earlier quoted context omitted.
I would rather have unpleasantries that make the language safer vs unpleasantries that make it more vulnerable. Especially when the unpleasantries in question don’t even make the language easier to use.
C standard: "Undefined behavior means such a situation can't happen." Me: "If it can't happen then it would be fine to just crash on those situations, right? Because such a crash would never be reached. Can we get that?" C compilers: "No. Would you want to crash on signed integer overflow, for example?" Me: "Yes? Would be safer than the current situation at least." C compilers: "What, no, that would make your program…
"No way to prevent this" say users of only language where this regularly happens
231–240 of 342 posts
Re: "No way to prevent this" say users of only language where this regularly happens
#232Earlier quoted context omitted.
It's not UB. It's also not covered by standard - it's implementation-specified. What will happen is dependant on decision of compiler writers. It is, however, not the only way to write to memmapped registers. The original C way of doing so was to use an assembly function wrapping the actual act of reading/writing (honestly, better than doing the above, as it helps making it very explicit how the write will happen as…
Both of the alternative do not generate same code though. At least they don't without LTO.
Re: "No way to prevent this" say users of only language where this regularly happens
#233Earlier quoted context omitted.
It's gross because I don't want to think about your sex life when at work, but I guess this type of exhibitionism is fine.
Why did you jump from 'cartoon characters having Socratic conversations' to 'sex life'? Good grief.
Anime is not inherently sexual as a medium but has a well-deserved reputation for being associated with creeps and perverts.
Don’t talk about either in professional settings.
Re: "No way to prevent this" say users of only language where this regularly happens
#234Re: "No way to prevent this" say users of only language where this regularly happens
#235Earlier quoted context omitted.
Most of the free democratic western world does not have a lax gun culture like the US has and yet there's no tyranny. Weird.
This isn't as clear cut of a case as you make it out to be. Britain's recently been on a path of overregulation bordering tyranny and limiting free speech. Canada is on a similar path. German green and red party politicians recently caught flack for trying to criminalize unpleasant critique. Press freedom and press independence are actively getting worse and Europe is setting course on a path of nationalism and conse…
Re: "No way to prevent this" say users of only language where this regularly happens
#236I've been doing programming for ~31 years in total and ~22 years professionally and at this point I have lost all hope that programmers at large will ever gain these mythic qualities called "self-reflection" and "introspection". Truth is, these people are simply afraid for their cozy jobs, that's all there is to it. Derivative states of mind like Stockholm Syndrome and Sunk Cost Fallacy are quite normal to appear in…
It's possible to write systematically safe code in C, no need to change language. People really just don't want to do it.
Re: "No way to prevent this" say users of only language where this regularly happens
#237More broadly: > "No way to prevent $THIS" say users of only language where $THIS regularly happens A weird psychological quirk I've noticed (of myself, and others) is we'll often exhibit a sort of 'programming language xenophobia', where we apathetically accept (or don't even notice) unpleasantries of our language of choice, yet be quite averse to the unpleasantries of other languages. Maybe it's due to sunk cost; ti…
No way to prevent "this", says C++ programmer.
Re: "No way to prevent this" say users of only language where this regularly happens
#238Earlier quoted context omitted.
C standard: "Undefined behavior means such a situation can't happen." Me: "If it can't happen then it would be fine to just crash on those situations, right? Because such a crash would never be reached. Can we get that?" C compilers: "No. Would you want to crash on signed integer overflow, for example?" Me: "Yes? Would be safer than the current situation at least." C compilers: "What, no, that would make your program…
It would have taken you less time to look up -fwrapv / -ftrapv / -fsanitize=signed-integer-overflow + -fsanitize-undefined-trap-on-error than write out that misleading dialog. :)
Last time I checked ubsan was a few years ago for a small program, and I've read stuff about it not being suitable for anything outside development (more like a valgrind complement than a release option) because of how it messed with environment variables and linked libraries or something, so I might not have the full picture.
Re: "No way to prevent this" say users of only language where this regularly happens
#239Earlier quoted context omitted.
It’s a cult, but you don’t have to join the cult. I use Rust both privately and more and more frequently professionally and I don’t really notice the cult community outside of smiling at it once in a while when it blows up on HN. We’re mostly adopting rust to replace our C, to protect us from ourselves. It’s just so much easier to hand off these sort of projects to developers who mainly work with things like Java or…
Mostly agreed with your comment though I still have to remark that every community has zealots and it's mystifying to me why are people so annoyed by Rust's. So it's hard to agree that "Rust is a cult". As you said, it's a pragmatic but also kinda niche language. I don't reach for it unless I can't do the job with others, easier and quicker to work with languages.
Because they're the ones that we keep hearing from right now. When it was the Haskell zealots showing up every few days, they were annoying. When it was the Lisp zealots, they were annoying.
Re: "No way to prevent this" say users of only language where this regularly happens
#240Earlier quoted context omitted.
Well, I'm glad that you volunteered to go live in Soviet Russia or Fascist Germany, or a disarmed Native American tribe. Disarming population leads to tyranny without consequences.
TIL almost every european country is in a state of tyrnanny. Also Yemen which is one of the only countries with somewhat similar gun ownership compared to usa (bit less than half as many guns per capita) must be the epitome of freedom and safety.
Perhaps it’s not the guns that are the problem? Perhaps it’s the overall dysfunction of the US as a country?