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,897417b380f5731e X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: STL, Ada, C++ (Was Re: The Next Microsoft?) Date: 2000/05/10 Message-ID: <8fab3r$642$1@slb6.atl.mindspring.net>#1/1 X-Deja-AN: 621361302 References: <8eu0ob$7qv$1@nnrp1.deja.com> <391328F0.1221@synquiry.com> <39133213.64A@Ganymede.com> <8f50hc$hpo$1@nnrp1.deja.com> <8f83i2$osk$1@slb1.atl.mindspring.net> Organization: MindSpring Enterprises X-Server-Date: 10 May 2000 00:39:23 GMT Newsgroups: comp.lang.ada Date: 2000-05-10T00:39:23+00:00 List-Id: In article , Brian Rogoff wrote: >On Tue, 9 May 2000, Richard D Riehle wrote: >> I wonder if there is a trade-off here between convenience and type >> safety. Ada tends to lean heavily in the direction of safety, >> and automatic instantiation seems not quite as focused on that issue. > >Overloading, runtime dispatching, and "use clauses" don't seem quite >as focused on safety either. The only way that automatic instantiation >is troubling is that in the case of a language like C++ it is undecidable, >I think in standard C++ they limit the depth of template expansion >(Hyman?) and I imagine a similar solution would be needed for Ada. Overloading is resolved at compile time. It is a little safer than run-time dispatching, according to some practitioners. Use clauses certainly can be problematic with regard to visibility, but they generally do not obviate type safety. Of course, Geoff Mendal's paper on this subject illustrates some of the concerns for use clauses with predefined types. The question I was raising was whether we would expect the same level of confidence from automatic instantiation we already expect from Ada's model of generic instantiation. >> For example, the model for generic formal package parameters in Ada >> forces the designer to create a generic signature package corresponding to >> the parameter. This makes automatic instantiation quite difficult to >> achieve, but has the benefit of pretty thorough compile-time evaluation >> of all the elements of the signature. > >> The goals of C++ are different from those of Ada. > >Programming languages don't have goals, people do. Languages are artifacts >that can and should be discussed dispassionately. Please excuse my inadvertant anthropomorphism of the languages. Perhaps I should have said, "The goals of the C++ designers were different from those of the Ada designers." With that clarification, I doubt you would disagree that there were some goals, at very minimum, a loose rationale, for the design of both languages under discussion. >> Also, >> those goals are intended to satisfy different levels of confidence in the >> final product. > >"C++ is deficient with respect to Ada in the safety critical realm" >"C++ has automatic instantiation" >"Therefore automatic instantiation is deficient ..." Well, actually, I began my posting with a question. I tried to phrase it interrogatively, although I may have let myself slip into an assertion now and then. Let me try again. Can we enjoy the same level of confidence in C++ automatic instantiation we have come to expect from Ada genericity? Having asked the question in that way, I realize that some in the Ada community might point out that SPARK does not support genericity because, for the designers of SPARK, even the conservative approach of Ada to genericity does not carry sufficient guarantee of reliability. >Your emotional rhetoric is unconvincing. Any language with type inference >has a kind of automatic instantiation and "lack of safety" is not a >reasonable negative claim to make. Yes, Brian. I am well-known for my letting my passion override my dignity when discussing technical concerns. Sigh. If I engage in future discussion on this topic, I shall restrain myself from any comment without having first cleansed myself of unruly emotions through the therapeutic agent of a cold shower. Meanwhile, my question stands. Richard Riehle richard@adaworks.com