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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2a34b7ad6c6a0774 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!news.buerger.net!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Efficiency of code generated by Ada compilers Date: Sun, 15 Aug 2010 14:32:49 +0200 Message-ID: <87lj88njim.fsf@mid.deneb.enyo.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: idssi.enyo.de 1281875570 7954 172.17.135.6 (15 Aug 2010 12:32:50 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:lgepnM/lwVSk40AZjgTUvLAcZW8= Xref: g2news1.google.com comp.lang.ada:13334 Date: 2010-08-15T14:32:49+02:00 List-Id: * Elias Salom�o Helou Neto: > I would like to know how does code generated by Ada compilers compare > to those generated by C++. I use C++ for numerical software > implementation, but I am trying to find alternatives. One thing, > however, I cannot trade for convenience is efficiency. Will Ada > compiled code possibly be as efficient as that generated by C++ > compilers? For Ada 83 features except tasking, performance will be very similar. > Also, I do need to have something similar to C++ "templated > metaprogramming" techniques. In particular, C++0x will introduce > variadic templates, which will allow us to write templates that will > generate efficient, type-safe, variable-argument functions. Is there > anything like that in Ada? You could try writing a code generator, possibly using ASIS. Whether this is practical depends on the task at hand. A code generator is typically not more difficult to build than a good template meta-programming library (which is a code generator, too, but has to be written in a rather bizarre way). > If any of the above questions is to be negatively answered, I ask: why > does Ada even exist? It's older than (modern) C++, so there is tons of software that uses it, and it has a relatively safe subset which is difficult to leave. > And further, is there any language which is _truly_ better > (regarding code maintainability, readability and developing ease) > than C++ and as overhead-free as it? D is often mentioned in this context. For many tasks, it's difficult to do significantly better than C++ without garbage collection, so the question is whether you can afford that. (Few Ada compilers support garbage collection, though.)