From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29fe9a340e0d180d X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Depending on passing mechanism Date: 1997/10/15 Message-ID: #1/1 X-Deja-AN: 280815307 References: <622b4t$nhe$1@gonzo.sun3.iaf.nl> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 876953334 30664 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1997-10-15T00:00:00+00:00 List-Id: Henry Baker replied: ``This is another one of those cases that give standards bodies such a bad name -- the behavior is well-defined as 'non-deterministic', but non-functional.'' Anyone who thinks that non-determinisitc = non-functional has some strqange misconceptions. In practice, for languages designed for efficiency, you often leave some apsects of behavior non-deterministic for very good reasons. The case at hand is a good example. To specify call by value or call by reference for arrays can lead to highly inefficient code in some circumstances. Similarly, over-constraining the order of evaluation (which affects only programs with strange side effects) can significantly damange the efficiency of generated code. In a later note to me (perhaps posted here I don't know), Henry commented that the amazing Java eliminates non-determinism. This is true, but the cost is very substantial in terms of the effect on efficiency of generated code. For example, the requirement for absolute adherence to IEEE would create efficiency catastrophes on machines like the Alpha and R10000, which are very nearly IEEE compliant but not quite. I say "would" because in practice Java implementations are quite cavalier about such details (you may remember a student who was studying fpt portability posting a note here that summarized his experience -- Ada good, Java terrible). Yes, if you don't care much about efficiency you can eliminate some but not all non-determinism (if you have tasking of some time, you cannot go all the way to eliminating ND, though certainly Ada's annex D goes pretty far along this route, about as far as is practical). As for non-determinism causing lack of functionality, it is certainly true that incompetent programmers who do not understand the language can create non-portable programs this way, but I must say that the particular example here is not one which seems to cause difficulties in practice.