comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tkoskine@kapsi.fi>
Subject: Re: ada commercial options
Date: 21 Apr 2011 09:37:53 GMT
Date: 2011-04-21T09:37:53+00:00	[thread overview]
Message-ID: <4daffaf1$0$2845$7b1e8fa0@news.nbl.fi> (raw)
In-Reply-To: Pine.LNX.4.64.1104210935070.1184@medsec1.medien.uni-weimar.de

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/



  reply	other threads:[~2011-04-21  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 18:21 ada commercial options tonyg
2011-04-18 18:49 ` Vinzent Hoefler
2011-04-18 19:59   ` Georg Bauhaus
2011-04-19  7:37   ` Maciej Sobczak
2011-04-20 23:24     ` Randy Brukardt
2011-04-21  6:18       ` Maciej Sobczak
2011-04-21  8:08       ` stefan-lucks
2011-04-21  9:37         ` Tero Koskinen [this message]
2011-04-21 19:58         ` Pascal Obry
2011-04-21 21:13           ` Georg Bauhaus
2011-04-21 21:19             ` Pascal Obry
2011-04-21 19:58         ` Pascal Obry
2011-04-21 23:42         ` Randy Brukardt
2011-04-22  5:55           ` Simon Wright
2011-04-23  0:50             ` Randy Brukardt
2011-04-21 20:16   ` Nicholas Collin Paul Gloucester
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox