News for hackers. Stuff that matters.
Re:Some were meant for C [pdf] by quelsolaar on Wednesday June 21, 2023 @04:29PM (#36423957)
C, is high level language that happens to map really well to hardware. Much of UB is UB simply because it difficult to effectively detect when something goes in to a state of UB. Writing to a memory address can be done in one instruction, but figuring out if that address is legal to write to is a slow and complicated process. The C standard let an implementation ignore that problem, but it is also does not stopping the implementation from making sure the address is valid before writing to it. Almost no one tries to make such an implementation, because the users have decided they would rather have speed, but anyone can write a ISO compliant implementation without any UB if that's what they want.
Re:Some were meant for C [pdf] by bandrami on Wednesday June 21, 2023 @04:58PM (#36424370)
It maps well to hardware from the 1970s and 1980s. It has very little to do with modern hardware, and for that matter modern hardware does some somersaults to present an interface that C "expects".
Re:Some were meant for C [pdf] by AlexAndScripts on Wednesday June 21, 2023 @05:20PM (#36424736)
What are the specific differences?
Re:Some were meant for C [pdf] by throwaway17_17 on Wednesday June 21, 2023 @06:32PM (#36425604)
The easiest read on this topic is Chris Chisnall’s ‘C is not a Low Level Language’ article [1]. It is a good read in general and not all that long. It addresses vectors, out-of-order execution, pipelining, and plenty of other topics along the way.

1 - https://dl.acm.org/doi/10.1145/3212477.3212479

Re:Some were meant for C [pdf] by quelsolaar on Wednesday June 21, 2023 @06:34PM (#36425623)
Modern hardware is designed to map to C rather than the other way around. Turns out people want to buy hardware that can run existing software.