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,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Ada Date: 2000/01/04 Message-ID: #1/1 X-Deja-AN: 568214172 References: <38620350.48F8FC08@gecm.com> <83tohh$q2s$1@nnrp1.deja.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> <874scu18cs.fsf@deneb.cygnus.argh.org> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 947005024 202 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-04T00:00:00+00:00 List-Id: On 4 Jan 2000, Florian Weimer wrote: > Hyman Rosen writes: > > [Ada generics vs. C++ templates] > > > Is there something specific you believe you can not > > do in C++ with regard to these abilities? > > I can't imagine anything which can't be done with C++ templates which > you can do using Ada generics. In some theoretical sense, yes, since you can express computations with C++ templates they can do just about anything. C++ type checking is also undecidable thanks to this. In the world of the practical programmer, Ada allows subprograms as generic parameters and since Ada has nesting you can use them to clumsily simulate many uses of downward closures. C++ forces you to use classes and overload "()", and that is IMO *way* more clumsy than the Ada workaround. Others have discussed strong typing and separate compilation, so I'll leave those points alone. What I like most about Ada is the confidence I have that a small compiled program is close to correct in my experience. I like some aspects of the C++ template systems ability to automatically instantiate, and would love to see an Ada-like language with this ability. I suspect that this might also not have a decidable type system. -- Brian