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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Fri, 29 Jun 2018 15:17:09 -0500 Organization: JSA Research & Innovation Message-ID: References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> <87602fbu2g.fsf@nightsong.com> <87po0mziqt.fsf@nightsong.com> <87fu1izfgs.fsf@nightsong.com> Injection-Date: Fri, 29 Jun 2018 20:17:10 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="1743"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:53444 Date: 2018-06-29T15:17:09-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:pgd1hq$ca2$1@gioia.aioe.org... ... > 4. No proper reuse. Generic bodies are no proper compilation units, you > cannot have a shared library of generics. Therefore the only possible form > of reuse is textual substitution and recompilation of the client code. Since Janus/Ada implements them exactly this way, this is demonstratably false. The lack of reuse in some implementations (i.e. GNAT) is an intended implementation decision, not a language requirement. > 5. No proper separation of interface and implementation. If you used Ada > generics you would know that successful compilation of a generic body > means little. Instantiation can always fail even if all formal parameters > match. The compiler must look into the body not just for the sake of > optimization and representation, but for validity of instantiation, just > like in C++. A macro is a macro. This is also False. Ada uses "assume-the-worst" rules such that any legal generic body is legal for any possible instantiation. There are *different* rules for the generic specification, and perhaps you are running afoul of those (those can cause failure of an instantiation). Or of compiler bugs causing compilation failures in instance bodies. Neither make the above true. In any case, it is technically impossible for the above to be true in Janus/Ada (the body is a regular compilation unit that is shared with all instances - it is never looked at during an instantation and the compiler doesn't have any saved information with which to do that anyway). Randy. >> I don't think it was a mistake >> for C++ to have generics since the generic approach in C++ is IME much >> better than the OO approach with inheritance. > > This is evidently wrong. Ada programs extensively using generics are as > impossible to maintain as C++ programs using templates. IMO generics have > no place in SW engineering. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de