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,ddf5660e3e8010b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!goblin2!goblin.stu.neva.ru!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Message-ID: <4daffaf1$0$2845$7b1e8fa0@news.nbl.fi> From: Tero Koskinen Subject: Re: ada commercial options Newsgroups: comp.lang.ada References: <5f171139-8296-4c7c-bc24-02885eadd260@dr5g2000vbb.googlegroups.com> <77c9c293-9fd3-4f3b-a754-83bf3d3be487@p16g2000vbi.googlegroups.com> User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.32.32-grseckapsi-bfsha (x86_64)) Date: 21 Apr 2011 09:37:53 GMT Organization: NBL Networks Oy NNTP-Posting-Host: 217.30.184.161 X-Trace: 1303378673 news.nbl.fi 2845 217.30.184.161:38209 X-Complaints-To: abuse@nblnetworks.fi Xref: g2news2.google.com comp.lang.ada:19917 Date: 2011-04-21T09:37:53+00:00 List-Id: stefan-lucks@see-the.signature wrote: > On Wed, 20 Apr 2011, Randy Brukardt wrote: > >> The vast majority of "libraries" written for GNAT aren't portable enough to >> use on other compilers, even if they only use Ada 95 features. In my >> opinion, a library isn't portable unless it is compiled on at least two >> different Ada compilers. > > Randy, could you describe which portability issues with real-world > libraries you know? Dedicated low-level stuff is hard to write portably, > but it seems to me that Ada actually makes it easy to write portable > general-purpose libraries. I am not Randy, but I have developed my portable unit testing library Ahven since 2007 and made it work on at least 4 different compiler families: - GNAT (Ada 2005 mode), - Janus/Ada (Ada 95 mode), - Irvine ICCAda (Ada 2005 mode), - ObjectAda (Ada 95 mode). In addition, most of my non-avr Ada code found from https://bitbucket.org/tkoskine/ is tested with above compilers. Issues which I usually run into are: 1. Compiler bugs - usually some compiler either doesn't understand the used syntax, crashes when parses the code, generates invalid code, or has a bug in its runtime. - from the above group, Janus/Ada is probably the "most buggiest" compiler, but others have their share also. (And even though I think the Janus/Ada being on top here, I still recommend it if one needs a cheap commercial Ada compiler for personal use.) - especially FSF GNAT seems to be plaqued by regressions, for example FSF GCC 4.5 cannot compile Ahven at all (versions 4.[2346] are ok). - I could say that my Ahven library is a real compiler bug magnet. Even though all the code is plain Ada 95 and the line count is only around 2K-3K, I still "all the time" hit into really interesting bugs, which one would have though being fixed many years ago. (I think the rate is around one compiler bug per month, for those months when I have time to do development.) 2. Performance differences - Unbounded_String performance varies a lot between compilers. One compiler can be 10 times faster than another. 3. Implementation status - Compiler doesn't implement some more or less optional feature. (This is probably more issue with Ada 2005 than Ada 95.) 4. Compilers warn about different things - You cannot compile code in warnings=errors mode on all compilers at the same time. > 4. Don't assume a certain Size about system constants, such as > Integer'Last. This bit me recently. Even though I knew that Integer is only 16 bit long in Janus/Ada, I didn't take into account that the maximum size of Unbounded_String is also limited by the size of Integer. In other words, you can store only 32 Kbytes to Unbounded_String. -- Tero Koskinen - http://iki.fi/tero.koskinen/