The A-Z of Programming Languages: Ada, interview with S. Tucker Taft

This is a discussion on The A-Z of Programming Languages: Ada, interview with S. Tucker Taft within the ADA forums in Programming Languages category; Dmitry A. Kazakov wrote: > On Thu, 05 Jun 2008 21:40:55 +0200, Georg Bauhaus wrote: > >> "A massive increase in complexity will result from 9X adding one or more >> additional possibilities where Ada now offers two. For example, 9X adds: >> [...] access parameters, to IN, OUT, and IN OUT; tagged types, to normal >> types; dispatched subprogram calls, to normal subprogram calls; use type >> clause, to use package clauses; ... With 9X, the number of interactions >> to consider is close to 60,000 since we have 3 or more possibilities in >> each case (that is, ...

Go Back   Application Development Forum > Programming Languages > ADA

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 06-06-2008, 01:57 PM
Georg Bauhaus
Guest
 
Default Re: The A-Z of Programming Languages: Ada, interview with S. TuckerTaft

Dmitry A. Kazakov wrote:
> On Thu, 05 Jun 2008 21:40:55 +0200, Georg Bauhaus wrote:
>
>> "A massive increase in complexity will result from 9X adding one or more
>> additional possibilities where Ada now offers two. For example, 9X adds:
>> [...] access parameters, to IN, OUT, and IN OUT; tagged types, to normal
>> types; dispatched subprogram calls, to normal subprogram calls; use type
>> clause, to use package clauses; ... With 9X, the number of interactions
>> to consider is close to 60,000 since we have 3 or more possibilities in
>> each case (that is, 3^10)." (OOSC2, §33.7, p.1095)

>
> I cannot decode this, so let it be...


That I don't believe.


>> The comment "adds: tagged types, to normal types" is particularly
>> interesting, I think, because it touches on a consequence of
>> this distinction: sloppy versus exact base type systems:

>
> In which sense "sloppy/exact"?


Sloppy/exact in the sense of mapping the set of problem or solution
values to a set of type values 1:1, bijectively.

When all you have is int, INTEGER, Int, etc. but your set of
whole numbers has bounds strictly inside (min machine-int,
max machine-int), say, then one type system allows you to exactly
give the lowest and highest whole number that your (sub)type is to
have. Another type system, namely that of Qi, even permits
computing a set of values using a Turing complete type declaration
language. So "only odd natural numbers" will be a perfectly normal
Qi type. A type definition that basically must use "int", but
the set of values is between 0 and 1_000_000, is sloppy in that
it does not express the set, neither to the reader nor to the
compiler.
You might recall the report that an embedded systems teacher
from a US university has summarized here. A base type system
that is a more exact representation of the solution sets does
help in programming.

>> Ada, as mentioned by Ichbiah, has "normal" types for defining
>> integers, reals, etc., and tagged types for defining polymorphic types.

>
> Tagged types aren't polymorphic. Only their classes (closures of) are.


Yes, and you define tagged types in order to get classwide
polymorphic types. There are no class-wide types rooted at
some non-tagged type. There is a universal type. This, I think,
reflects the tagged vs normal distinction Ichbiah is listing.


>> You want integers between 0 and 10_000 only? Define a corresponding
>> normal type, or do "normal" derivation from another integer type
>> adding the needed constraint.
>> (Part of the language since Ada 83 as pointed out by J.-P. Rosen above.)

>
> Well, I understand this complain. Actually, there is no semantic difference
> between:
>
> subtype S is T ...; -- "Normal" derivation


No, that is not meant by "normal" derivation; rather

type S is new T; -- Semicolon, no "with"


> Clearly, all of them should have same syntax.


Yes, I speculate that this is what Ichbiah might have liked,
and why he list "9X adds: tagged types, to normal types; "

> Clearly interfaces are
> superfluous when abstract types could do anything they do and more.
> Further, interfaces are damaging to software design. One is forced
> permanently factor out interfaces out of types instead of trivial interface
> inheritance from concrete types.


Trivial?


>> So maybe there is good reason to have both normal types, and tagged
>> types, even if this complicates the language?

>
> No, there is no substantial difference between two mechanisms, once one has
> separated polymorphic (class) and specific (type) as Ada 95 did, all types
> become "normal." Abnormal are classes, which you aren't forced to use as
> they are completely orthogonal to "normal" types.


Whatever the mechanisms are, two mechanisms are never even close to
"the same" if the programmer has to learn a great deal in order to
see how they are substantially the same.

Reply With Quote
  #12  
Old 06-06-2008, 03:34 PM
Dmitry A. Kazakov
Guest
 
Default Re: The A-Z of Programming Languages: Ada, interview with S. Tucker Taft

On Fri, 06 Jun 2008 19:57:26 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
>> On Thu, 05 Jun 2008 21:40:55 +0200, Georg Bauhaus wrote:
>>
>>> "A massive increase in complexity will result from 9X adding one or more
>>> additional possibilities where Ada now offers two. For example, 9X adds:
>>> [...] access parameters, to IN, OUT, and IN OUT; tagged types, to normal
>>> types; dispatched subprogram calls, to normal subprogram calls; use type
>>> clause, to use package clauses; ... With 9X, the number of interactions
>>> to consider is close to 60,000 since we have 3 or more possibilities in
>>> each case (that is, 3^10)." (OOSC2, §33.7, p.1095)

>>
>> I cannot decode this, so let it be...

>
> That I don't believe.


You must. (:-)) I really do not understand what he writes about.

>>> The comment "adds: tagged types, to normal types" is particularly
>>> interesting, I think, because it touches on a consequence of
>>> this distinction: sloppy versus exact base type systems:

>>
>> In which sense "sloppy/exact"?

>
> Sloppy/exact in the sense of mapping the set of problem or solution
> values to a set of type values 1:1, bijectively.
>
> When all you have is int, INTEGER, Int, etc. but your set of
> whole numbers has bounds strictly inside (min machine-int,
> max machine-int), say, then one type system allows you to exactly
> give the lowest and highest whole number that your (sub)type is to
> have. Another type system, namely that of Qi, even permits
> computing a set of values using a Turing complete type declaration
> language. So "only odd natural numbers" will be a perfectly normal
> Qi type. A type definition that basically must use "int", but
> the set of values is between 0 and 1_000_000, is sloppy in that
> it does not express the set, neither to the reader nor to the
> compiler.


I see. But this is an invalid distinction. Your statement is not about
properties of the types. It is about types being improperly used. You can
misuse a tagged type in the same or a worse way as you did integer.

>>> Ada, as mentioned by Ichbiah, has "normal" types for defining
>>> integers, reals, etc., and tagged types for defining polymorphic types.

>>
>> Tagged types aren't polymorphic. Only their classes (closures of) are.

>
> Yes, and you define tagged types in order to get classwide
> polymorphic types.


No. Tagged types are defined in order to have inheritance. Class-wide
programming (polymorphism) is an orthogonal issue. Often you can have a
rich hierarchy of types, but no polymorphic objects. It really depends on
the application. Polymorphic objects appear only when specific types become
indeterminable at compile time.

> There are no class-wide types rooted at
> some non-tagged type. There is a universal type. This, I think,
> reflects the tagged vs normal distinction Ichbiah is listing.


But the point is that any type should have a class rooted in it. The
distinction made between tagged and non-tagged was arbitrary. tagged vs.
non-tagged is actually by-reference vs. by-compiler-choice. Ada 95 did a
mistake conflating these.

>>> You want integers between 0 and 10_000 only? Define a corresponding
>>> normal type, or do "normal" derivation from another integer type
>>> adding the needed constraint.
>>> (Part of the language since Ada 83 as pointed out by J.-P. Rosen above.)

>>
>> Well, I understand this complain. Actually, there is no semantic difference
>> between:
>>
>> subtype S is T ...; -- "Normal" derivation

>
> No, that is not meant by "normal" derivation; rather
>
> type S is new T; -- Semicolon, no "with"


This is not a derivation, it is cloning.

(Another mistake of Ada 95 was that type cloning was lost for tagged types.
Cloning is an important operation of types algebra independent of classes
and inheritance. So you need the monstrous generics in order to clone
tagged types, loosing taggedness on the way.)

>> Clearly interfaces are
>> superfluous when abstract types could do anything they do and more.
>> Further, interfaces are damaging to software design. One is forced
>> permanently factor out interfaces out of types instead of trivial interface
>> inheritance from concrete types.

>
> Trivial?


Consider:

type A is ...;
procedure Foo (X : A);

type B is private A; -- B inherits only the interface of A (not Ada!)

This is trivially equivalent to:

type Anonymous_Interface_Of_A is limited interface;
procedure Foo (X : Anonymous_Interface_Of_A) is abstract;

type A is new Anonymous_Interface_Of_A ...;
overriding procedure Foo (X : A);

type B is new Anonymous_Interface_Of_A;

Does this look difficult?

>>> So maybe there is good reason to have both normal types, and tagged
>>> types, even if this complicates the language?

>>
>> No, there is no substantial difference between two mechanisms, once one has
>> separated polymorphic (class) and specific (type) as Ada 95 did, all types
>> become "normal." Abnormal are classes, which you aren't forced to use as
>> they are completely orthogonal to "normal" types.

>
> Whatever the mechanisms are, two mechanisms are never even close to
> "the same" if the programmer has to learn a great deal in order to
> see how they are substantially the same.


This only because he is forced to learn the same thing twice. Then he will
learn combinations of these two same things in different contexts.

Yes, this leads to a combinatorial explosion, which is absolutely
unnecessary. Look how introducing totally superfluous interfaces exploded
the language. You have limited, non-limited, protected, synchronized etc
interfaces, where single word "abstract" would be enough!

So? "entities must not be multiplied beyond necessity"

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
Reply With Quote
  #13  
Old 06-11-2008, 09:57 PM
Randy Brukardt
Guest
 
Default Re: The A-Z of Programming Languages: Ada, interview with S. Tucker Taft

"Ed Falis" <falis@verizon.net> wrote in message
newsp.ub96mfvb5afhvo@naropa...
> On Thu, 05 Jun 2008 09:58:36 -0400, Georg Bauhaus
> <rm.dash-bauhaus@futureapps.de> wrote:
>
>> IIUC what Taft says in the interview, Ichbiah didn't like the
>> _way_ OOP was to be implemented. OTOH he had been working on a
>> Simula compiler at INRIA. So maybe OOP alone was not the elephant.
>>

>
> I wasn't there, but rumor had it that JDI wanted to use the term "class"
> (rather than "tagged type") for consistency with other OO languages. I
> don't know what his other disagreements were.


I *was* there, and that was a major contention between two groups. (I was on
Ichbiah's side on this argument, but I didn't quit when I lost. ;-). I don't
recall any technical objections that he had. The whole discussion
degenerated into something rather theratical. I don't want to go into
detail, because I don't want to speak ill of the dead (or of the living, for
that matter).

I personally thought that using derived types (which no one understood in
Ada 83) to implement classes was a mistake. Tucker was adamant on this
point. I'm still not sure if he was right, but I'm used to it now. (Adding
overriding indicators surely helps a lot, by indicating the programmers
intent.)

Randy.



Reply With Quote
  #14  
Old 06-12-2008, 03:25 AM
christoph.grein@eurocopter.com
Guest
 
Default Re: The A-Z of Programming Languages: Ada, interview with S. TuckerTaft

On 12 Jun., 03:57, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
> I personally thought that using derived types (which no one understood in
> Ada 83)


What do you mean? I used type derivation a lot in Ada 83 with much
benefit for handling physical types adding new operations on the
derived type.

And there is the trick attributed to John Goodenough to add user-
defined equality to any type.

> to implement classes was a mistake. Tucker was adamant on this
> point. I'm still not sure if he was right, but I'm used to it now.


Why this? I think that using the Ada 83 type derivation facility for
this is very natural. Why invent a completely new technique?
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:50 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.