comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Ada & MacOS
Date: Mon, 06 Feb 2006 20:25:21 +0100
Date: 2006-02-06T20:25:21+01:00	[thread overview]
Message-ID: <4047936.ucMNu27ket@linux1.krischik.com> (raw)
In-Reply-To: ds70ss$onv$1@sunnews.cern.ch

Maciej Sobczak wrote:

> Martin Krischik wrote:
> 
>>>OK but how with the compatibility of code compiled on Gnat that is part
>>>of GCC between MacOS, Windows and Linux ?
>> 
>> It's Ada not C or C++. Ada compilers obey and not ignore the ISO
>> standart. Ada compilers come without a 10 page list of ISO standart
>> features not yet and probably never to be implemented. Ada does not only
>> have an ISO standart - it also has an ISO standart test suite. BTW: The
>> only programming language with an official standart test suite.
>> 
>> Ada is most likely the most compatible programming language in existence
>> that compiles into binary code.
> 
> Of course, not counting "features" of different compilers, right? If you
> say "Ada compiler", then is GNAT a good example? Doesn't it have any
> "features" that can affect compilability/behaviour of some code?

Sure it has. Most of them start with "GNAT." or "System.". Important is that
there are no missing features. You can avoid added feature but one which is
missing cannot be replaced.

> The words "compiler bug" appear in comp.lang.ada archive, don't they?
> 
> In the same way, C++ guys can say that C++ is an incredibly portable
> language, with compilers existing for almost every piece of silicon in
> existence. Well, except of some compiler "features" that spoil the
> picture, of course.

>> That's for theory, in pratice: I have used Ada with OS/2, MS-Windows,
>> Linux,
>> OpenVMS and the tendency is:  if it runs in one OS it will run on any
>> other as well. Well: unless you use OS specific features or grab deep
>> down into the System packages.
> 
> Same for C++. One of the users of my recent code (non-trivial, I would
> say) compiled it on MacOS by typing "make", even though I've never
> touched Mac. So?

Well I ported some OS/2 code to Windows. I had lot's of fun with:

unsigned&
key (int& x)
  {
  return x;
  }

Of corse not at easy as displayed here. It was deeply nested inside a
template. So one could not the see the type mismatch imediatly. Fun was
that one compiler interpreted the statement as:

  return static_cast <unsigned&> (x);

while the other sought it would be more fun to do:

 return static_cast <unsigned> (x);
 
Wonder what the difference is? Well the 2nd option expands to:

 auto unsigned temp =  static_cast <unsigned> (x);
 return temp;

Great fun. Since all the template did with the keys was comparing them it
did not actually crash using a pointer to a stack temporary which is
deallocated. And sometimes the correct values might still be available on
the stack.

Great fun. I fact such great fun that I started to look for an Ada job.

> Granted, the fact that Ada has a standard test suite is a Very Good
> Thing, really. The lack of such test suite for C++ allowed various
> vendors to put big "C++" letters on whatever shi^H^H^H product they
> wanted to sell over the last decade or so and that's the cause for the
> C++ landscape to look so messy today. But don't present it to be
> entirely hopeless, because it isn't.

Yes indeed. I have gathered a little hope when I was pointed to the only
compliant compiler available: http://www.comeaucomputing.com.

But how about a little quiz: Which of the two compiler in question where
right?

Or a little test: We ask comp.lang.cpp which of the two compiler in question
where right?

I can tell you: If you ask a question like this here in c.l.a then in less
then 24 hours you have an answer beginning with:

In the RM X.Y.Z(W) it says .... 

With RM being the Ada Reference Manual ISO/IEC 8652:1995 and X.Y.Z(W) being
chapter, sub-chapter and line number.

With programmers who can quote the RM in there slep no compiler vendor can
dare to bring out a shi^H^H^H inferior compiler.

On the other Hand: I have a copy of the C++ RM as well. But I can't read 2
sentences without getting a headache.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



  parent reply	other threads:[~2006-02-06 19:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 10:53 Ada & MacOS sg
2006-02-02 14:48 ` Alex R. Mosteo
2006-02-02 17:13 ` Martin Krischik
2006-02-02 19:37   ` sg
2006-02-02 21:30     ` Björn Persson
2006-02-02 23:17       ` sg
2006-02-03  7:32         ` Jean-Pierre Rosen
2006-02-03 19:38           ` Jeffrey R. Carter
2006-02-06 10:15             ` Jean-Pierre Rosen
2006-02-03 16:27         ` Martin Krischik
2006-02-03 19:43           ` Jeffrey R. Carter
2006-02-04  7:04             ` Martin Krischik
2006-02-04 14:32               ` Georg Bauhaus
2006-02-06  8:20           ` Maciej Sobczak
2006-02-06 18:48             ` Jeffrey R. Carter
2006-02-06 20:44               ` Hyman Rosen
2006-02-07  9:10               ` Maciej Sobczak
2006-02-07 16:16                 ` Martin Krischik
2006-02-08  4:51                 ` Jeffrey R. Carter
2006-02-08  7:35                   ` Alex R. Mosteo
2006-02-09 14:52                   ` Maciej Sobczak
2006-02-06 19:25             ` Martin Krischik [this message]
2006-02-06 20:34               ` Hyman Rosen
2006-02-07 16:13                 ` Martin Krischik
2006-02-03 23:55         ` Simon Williams
2006-02-04 16:22 ` Adrian Hoe
2006-02-04 16:25 ` Adrian Hoe
replies disabled

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