News for hackers. Stuff that matters.
Re:Why Not Just Do Simple C++ RAII in C? by einpoklum on Wednesday May 22, 2024 @03:57PM (#40445615)
You don't necessarily want that. Forcing language-defined semantics on everything costs performance. Sorry, it just does, we can't have it all. So, you can sacrifice performance for well-defined'ness, or you can choose not to - and the choice depends on the language _design goals_. As the design goals differ, so do the combinations of choices made for syntax and semantics.
Re:Why Not Just Do Simple C++ RAII in C? by bigstrat2003 on Wednesday May 22, 2024 @04:14PM (#40445828)
I think pretty much any amount of performance is worth sacrificing in order to get rid of the gnarly things UB can cause. Correctness is the first and most important thing in programming, because if you can't be certain it works then it's not very useful.
Re:Why Not Just Do Simple C++ RAII in C? by einpoklum on Friday May 24, 2024 @01:55AM (#40463237)
It may be worth it _for you_. It is not worth it _for others_.

Correctness can be established well enough - even if guaranteed automatically - in a language with UB.