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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tsicnews.teliasonera.com!news.otenet.gr!news.grnet.gr!newsfd02.forthnet.gr!not-for-mail From: Ioannis Vranos Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Fri, 11 Mar 2005 21:23:33 +0200 Organization: FORTHnet S.A., Atthidon 4, GR-17671 Kalithea, Greece, Tel: +30 2109559000, Fax: +30 2109559333, url: http://www.forthnet.gr Message-ID: <1110569032.207770@athnrd02> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> NNTP-Posting-Host: athnrd02.forthnet.gr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: athprx02.forthnet.gr 1110569032 28059 193.92.150.73 (11 Mar 2005 19:23:52 GMT) X-Complaints-To: abuse@forthnet.gr NNTP-Posting-Date: Fri, 11 Mar 2005 19:23:52 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: Cache-Post-Path: newsfd02!unknown@ppp16-adsl-170.ath.forthnet.gr Xref: g2news1.google.com comp.lang.ada:9160 comp.lang.c++:45207 comp.realtime:1299 comp.software-eng:4867 Date: 2005-03-11T21:23:33+02:00 List-Id: Dr. Adrian Wrigley wrote: >>Ada features I would love to have in C++: >>* "new types" and sub-ranges I do not know what you mean exactly by that, however one can define his own types rather than having everything as built-in. C++ provides general purpose facilities with which one can build his own special purpose libraries, rather than providing special purpose facilities as built in. Consider std::complex as a complex type, rather than a built in complex type. >>* runtime template instantiation (I think being able to instantiate >>generics dynamically is the coolest thing!) > > > This would be nice! From my (perhaps limited) experience of .NET where run-time generics are also available to C++ (with the upcoming C++/CLI, .NET 2 and VC++ 2005 - currently Beta), run-time generics are more limited than compile-time templates. Also since they are run-time they are less efficient. > Vital! C++ and C suffer a lot from not enforcing encapsulation, > allowing headers to break stuff etc. Better control of scope > and visibility. Better separation of interface and implementation May I assume that packages are a form of precompiled dynamic-link libraries, like dlls in Windows? > My list of Ada features I would love to have in C++ adds: > > Concurrency. Will be available in C++0x. Today is platform-specific, but there is also a standard about C++, OpenMP (see below). > Tasks. Protected objects. > Distributed programs. Persistent variables. > > Eliminate large swathes of the C++ standard which leaves > the semantics up to the compiler! > > Named parameter association. Proper parameter modes > "out" and "in out" modes > > clarity over arrays. C++ gives you choice of pointers > C arrays, vectors. This is one example of where the > 'C' facilities were too limited, and C++ added > alternatives, rather fhan fixing what existed in C. > (and char *, char arrays, string etc) > > Strong(er) typing, better enumerations, fixed point types, > modular types *and* non-modular types. Basic type attributes. > > More robust, more readable, less terse syntax, particularly > for complex templates (really!) I assume you are right, concerning newcomers, but for me Ada's syntax is the bizarre one (apart from the Pascal "subset"). :-) > Portability without resorting to preprocessor directives > and conditional compilation These are used essentially for system-oriented code. > -------------------------------------------------------------- > My list of C++ features I would love to have in Ada adds: > > simple and direct interfacing to C/C++ header files - a *big* > drawback of Ada :( > > template specialization > > extra parameters with "new" > -------------------------------------------------------------- > But what of features not present in either? > > Introspection > > Dynamic compilation/interpretation This is against the systems programming bias of C++. Also there are C++ interpreters out there. Here is a nice, small one: http://home.mweb.co.za/sd/sdonovan/underc.html > parallel execution constructs (see Cilk, Occam's "par") > coroutines Today there is OpenMP: http://www.openmp.org/drupal > configurations (from VHDL) > > associative arrays (from Perl) I am not sure if you mean this, however standard C++ library provides map and multimap. -- Ioannis Vranos http://www23.brinkster.com/noicys