Re:Awesome Pascal – A curated list of Delphi, FreePascal, an...
by augustk on Monday May 13, 2019 @11:47AM
(#19900455)
If you are implementing a compiler you do what makes most sense for the target language/machine. On the other hand, if you specify exactly how each ill-defined operation should be handled you
1. restrict the freedom of compiler writers. On very small systems, for instance, array bound checking may not be implemented,
2. make programmer rely on non-obvious behaviour/results which makes programs harder to understand and maintain,
3. make the language specification more complicated.
Similar question is also about pointers, what happens if you try to use p^ when p is nil? Do you try to access whatever address nil represents? Do you abort?
C has the notion of undefined behavior and it is explicitly mentioned, but Oberon-07 doesn't mention this at all meaning that implementations need to make those decisions.