next up previous
Next: 4 Encapsulation Up: Differences between Sather-1.0 and Previous: 2 Main Goals

3 Determinism


Sometimes the textual or temporal ordering of language constructs is important. In general, ordering presents problems because programs which depend on a particular ordering are usually relying on some subtle property that would be better if it were explicit. S1 and SK agree that programs which rely on ordering are often poorly designed, and writing such programs should be prevented if possible. The best of all worlds would be to detect reliance on ordering and make it a compile time error. Unfortunately, doing so does not appear tractible.

In general, the S1 approach has been to avoid harm from ambiguous orderings by defining a canonical result. More generally, S1 is deterministic both within and between platforms, with the exception of converting pointer values to integers for use in hash tables, and code which exploits the number of bits in INT or CHAR. In general the SK approach has chosen the traditional approach of not attempting to rescue the programmer from nondeterminism. However, non-deterministic semantics may offer more opportunities for optimizing code.

There are a number of places where the handling of ordering creates a language difference: