4 ms·
Python many times had the problem of being defined as CPython. Modules that target multiple Python implementations often have to work around differences between
by steerablesafe 6y ago
Python many times had the problem of being defined as CPython. Modules that target multiple Python implementations often have to work around differences between them, without a standard they have to look into implementation details of their targets. Not having a standard is definitely a pain.
But for most intents and purposes Python is defined by its documentation, and it's fine.
Having said that UB in C and C++ means behavior that the standard doesn't define. If you remove the standard then UB either loses meaning or it makes all programs undefined. It definitely doesn't make all programs defined.
- btrask 6y agoIf you remove the standard, wouldn't everything naturally be implementation-defined? Like, say, Python.
- nwmcsween 6y agoYep and you would end up with what was occuring before there a standard was created (POSIX, etc) which is generally a giant dumpster fire of implementation defined hell.
- btrask 6y agoHave you thought about why having a standard causes all these problems with undefined behavior? The point of a standard is to be less specific than a reference implementation. That's why it's written in English, not code. That means definitions are fuzzy, which is why every kind of English-language law, rule, or spec is vulnerable to malicious compliance. If C had a judge, like the legal system, he could deny attempts to use fuzziness in the standard (intended to prevent specifying bugs) to introduce bugs. Unfortunately, C doesn't have a judge with common sense, it has people who think the standard is code and anything that is undefined really is a license to do whatever you want. I guess this problem was inevitable as soon as the words "nasal demons" were put to keyboard. Now the only thing that can save us is a reference implementation.