Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes the CPU is vendor defined behavior. However they usually write a spec.

The point is “undefined behavior” is more about gaps in the standard than bugs in programs.



Undefined Behaviour in C is the opposite of a gap in the standard. It's behaviour that's addressed in the standard that for historic, political, and performance reasons is allowed to be inconsistent. That's the reason it sucks to have been bitten by it (e.g. to find out that shifting N-1 bits out of an N sized integer gives you 0 bits, but shift that Nth bit and all bets are off)


So your claim is that a new language could define a spec to a degree that it would not have similar problems?


Yes? The combination of "historic, political, and performance" is a particular choice. Our attitudes to all of these are different to when C was maturing, particularly where reliability and security are involved.

And not least of all, we've learned more about programming language development than when C was created.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: