4 ms·
It's also not entirely true.....undefined behavior also exists because it's a serious pain to define every detail of a language. The only language I know of tha
by ktRolster 10y ago
It's also not entirely true.....undefined behavior also exists because it's a serious pain to define every detail of a language. The only language I know of that is completely defined (other than toy languages) is ML......and the authors felt the work to completely define it wasn't entirely worth the effort.
- nostrademons 10y agoAnd HTML. Every sequence of bytes is an HTML document with some defined meaning. It may not be valid HTML (the spec does define parse errors), but it will parse to the same representation in all conforming parsers.
- pron 10y agoJava is also completely defined and pretty completely specified. But don't confuse unspecified behavior with undefined behavior. Unspecified behavior means that one of several things can happen, but it's unspecified which. Undefined behavior means that absolutely anything can happen, including things that are not part of normal application behavior.
- Terr_ 10y ago> Unspecified behavior I feel like "unspecified" still sounds too lax. How about "implementation-defined"? I'm thinking of scenarios like: "When this occurs, The Java Virtual Machine implementation may choose to either X or Y. If it does Y, then it shall throw a Z exception."
- tempodox 10y ago> and the authors felt the work to completely define it wasn't entirely worth the effort. Can you add a source link? I would be interested in looking it up.
- ktRolster 10y agoI believe it was in this book: https://www.amazon.com/Masterminds-Programming-Conversations-Creators-Languages/dp/0596515170 https://www.amazon.com/Masterminds-Programming-Conversations...
- pjmlp 10y agoEiffel is also completely defined. It is one of the few languages that has denotational semantics as part of the language definition. It was also one of the first languages to fix the null reference problem (called Void-safety in Eiffel speak). Had the compilers been a bit cheaper instead of targeted to the enterprise customers, maybe many more would be enjoying writing safe native compiled software on Eiffel.