comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Depending on passing mechanism
Date: 1997/10/15
Date: 1997-10-15T00:00:00+00:00	[thread overview]
Message-ID: <dewar.876965810@merv> (raw)
In-Reply-To: dewar.876952904@merv


Henry suggests

<<1.  _Always_ pass by reference.  This can be forced in C/C++ by certain
  coding styles.  Any aliasing is assumed to be programmer-intended, and
  has a relatively simple programming model.  (You may have to liberally
  sprinkle 'volatile'-type thingy's around as well.)  There is a certain
  cost, but on modern microprocessors the cost is not exorbitant, and certainly
  less than the cost of a 777.>>

This is VERY difficult in distributed environments where there is no
shared memory between caller and callee, and prohibitively expensive.
(The 777 rhetoric does not make this problem go away!)

It is of course possible to force this same effect in Ada 95, by the
use of access parameters, or by-reference types.

  <<2.  _Always_ pass by value.  This is really possible only in a 100%
  functional language like Haskell.>>

Nonsense, it is always possible to pass by value, I have no idea what
Henry is talking about when he says this. Certainly not Ada. The penalty
for passing by value is simply the cost of copying (once for in
parameters, twice for in out), but these copies can be prohibitively
expensive for large arrays.

  <<3.  Add a new concept to your language: 'linear'/'unique' types.  These
  objects are guaranteed to be singly referenced because this is enforced
  by the type system.  Poof!  No aliasing!  This concept was pioneered by
  NIL/Hermes, and has recently been incorporated into some logical (prolog-like)
  languages and some functional languages ('Clean' from KU Leaven).  There is a
  large and growing body of mathematics called 'linear logic' that puts linear
  types on a firm theoretical foundation.>>

Well certainly not relevant to the issue at hand, and I find the attempt
to connect the foundation of this programming language idea, which is
shaky, with linear logic, which is not, tenuous at best!

  <<The NIL/Hermes people tried to get people in the Ada community to pay
  attention, but they were completely ignored, and Ada95 suffered for it.>>

The contribution was not relevant, and the price is imaginary.

Not clear that this has much to do with the actual problem at hand, which
is figuring out the desirable semantics for parameter passing in Ada 95.
Note incidentally that Ada 95 is very different from Ada 83 here. In Ada
83, an execution whose effect depended on the parameter passing mechanism
was erroneous, but effect was ill-defined. In Ada 95, the semantics of
programs that depend on the passing mechanism is simply non-deterministic.

Note that almost no reasonably written
program will depend on the passing mechanism -- indeed the SPARK subset
which someone alluded to does not eliminate the non-determinism in a 
formal sense, it just makes sure that it could not affect the results,
which will typically be achieved in most programs in any case.)






  parent reply	other threads:[~1997-10-15  0:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-13  0:00 Depending on passing mechanism Andre Spiegel
1997-10-13  0:00 ` Matthew Heaney
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00   ` Henry Baker
1997-10-15  0:00     ` Geert Bosch
1997-10-15  0:00       ` Henry Baker
1997-10-15  0:00         ` Jon S Anthony
1997-10-15  0:00         ` Robert Dewar
1997-10-16  0:00         ` Brian Rogoff
1997-10-17  0:00           ` Henry Baker
1997-10-18  0:00             ` Brian Rogoff
1997-10-18  0:00               ` Matthew Heaney
1997-10-19  0:00                 ` Brian Rogoff
1997-10-21  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Robert Dewar
1997-10-22  0:00                       ` Brian Rogoff
     [not found]                         ` <dewar.877601826@merv>
1997-10-23  0:00                           ` Brian Rogoff
1997-10-23  0:00                       ` Henry Baker
1997-10-23  0:00                     ` Brian Rogoff
1997-10-19  0:00               ` Fergus Henderson
1997-10-19  0:00                 ` Brian Rogoff
1997-10-20  0:00                   ` Fergus Henderson
1997-10-20  0:00                 ` Henry Baker
1997-10-20  0:00                   ` Tucker Taft
1997-10-21  0:00                     ` Geert Bosch
1997-10-18  0:00             ` Fergus Henderson
1997-10-15  0:00       ` Robert Dewar
1997-10-15  0:00         ` Brian Rogoff
1997-10-19  0:00           ` Robert Dewar
1997-10-22  0:00             ` Henry Baker
1997-10-15  0:00         ` Robert Dewar [this message]
1997-10-17  0:00           ` Andre Spiegel
1997-10-17  0:00             ` Henry Baker
1997-10-17  0:00               ` Robert I. Eachus
1997-10-17  0:00               ` Jon S Anthony
1997-10-21  0:00               ` Robert A Duff
1997-10-21  0:00                 ` Peter Hermann
1997-10-22  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Brian Rogoff
1997-10-22  0:00                 ` Henry Baker
1997-10-21  0:00                   ` Robert Dewar
1997-10-22  0:00                   ` Brian Rogoff
1997-10-22  0:00                   ` Jon S Anthony
1997-10-15  0:00     ` JP Thornley
1997-10-21  0:00     ` Robert A Duff
1997-10-22  0:00       ` Henry Baker
1997-10-21  0:00         ` Matthew Heaney
1997-10-22  0:00           ` Simon Wright
1997-10-23  0:00           ` Henry Baker
1997-10-23  0:00             ` Pat Rogers
1997-10-24  0:00             ` Robert Dewar
1997-10-23  0:00         ` Robert A Duff
1997-10-21  0:00   ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox