comp.lang.ada
 help / color / mirror / Atom feed
* Ada & MacOS
@ 2006-02-02 10:53 sg
  2006-02-02 14:48 ` Alex R. Mosteo
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: sg @ 2006-02-02 10:53 UTC (permalink / raw)


Hi,
I'm going to develop a small (later it will be bigger as further modules 
come up) application for small business. It is going to work under 
windows, linux and macos having very similar GUI and using common 
database (it will be PostgreSQL). I wanted to use 
C++/wxWindows/PostgreSQL for that but I'd rather go in the Ada 
direction, so I've got some questions:

1. Is it possible to such a program in Ada with as less work as possible 
while creating GUT for another OS ? I wanted to develop it under 
windows, and then try to run it under MacOS without too much work, I 
want to avoid the situation when I have to create another another GUI 
from the beginning.

2. Is there any compiler for Ada under MacOS that is compatible with a 
compiler for Linux and Windows.

3. Does anybody have any experience with using PostgreSQL with Ada on 
all of theese systems (or maybe choose another database) ?

4. How about prining with gtkAda ?

regards
Szymon Guz



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 10:53 Ada & MacOS sg
@ 2006-02-02 14:48 ` Alex R. Mosteo
  2006-02-02 17:13 ` Martin Krischik
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 27+ messages in thread
From: Alex R. Mosteo @ 2006-02-02 14:48 UTC (permalink / raw)


sg wrote:
> Hi,
> I'm going to develop a small (later it will be bigger as further modules 
> come up) application for small business. It is going to work under 
> windows, linux and macos having very similar GUI and using common 
> database (it will be PostgreSQL). I wanted to use 
> C++/wxWindows/PostgreSQL for that but I'd rather go in the Ada 
> direction, so I've got some questions:
> 
> 1. Is it possible to such a program in Ada with as less work as possible 
> while creating GUT for another OS ? I wanted to develop it under 
> windows, and then try to run it under MacOS without too much work, I 
> want to avoid the situation when I have to create another another GUI 
> from the beginning.

Note that I have experience only in windows/linux. So I don't know if 
any of this can be extended to MacOS.

Possibilities for portable gui: GtkAda?, web interface embedding a 
server (AWS[1]) in your program. I don't know about wxWindows and Ada 
(though I'm interested, I don't like GtkAda that much).

Creating web guis for AWS can be fun... At least I enjoyed it the only 
time I did it. Much more than using GtkAda. Just a personal taste.

> 2. Is there any compiler for Ada under MacOS that is compatible with a 
> compiler for Linux and Windows.

No idea, but this seems relevant: http://www.macada.org/

> 3. Does anybody have any experience with using PostgreSQL with Ada on 
> all of theese systems (or maybe choose another database) ?

I've used the GNADE[2] binding to the PSQL client library with success. 
It's really straightforward to use. It works equally well in windows and 
in linux.

> 4. How about prining with gtkAda ?

No idea...

[1] https://libre2.adacore.com/aws/
[2] http://gnade.sourceforge.net/
	You only need four files for the PSQL binding:
	gnu.ads, gnu-db.ads, gnu-db-postgresql.ad[sb]



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  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-04 16:22 ` Adrian Hoe
  2006-02-04 16:25 ` Adrian Hoe
  3 siblings, 1 reply; 27+ messages in thread
From: Martin Krischik @ 2006-02-02 17:13 UTC (permalink / raw)


sg wrote:

> 2. Is there any compiler for Ada under MacOS that is compatible with a
> compiler for Linux and Windows.

Yes: GNAT. Start here:

http://en.wikibooks.org/wiki/Ada_Programming/Installing
http://gnuada.sourceforge.net/
https://libre2.adacore.com/

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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 17:13 ` Martin Krischik
@ 2006-02-02 19:37   ` sg
  2006-02-02 21:30     ` Björn Persson
  0 siblings, 1 reply; 27+ messages in thread
From: sg @ 2006-02-02 19:37 UTC (permalink / raw)


Martin Krischik napisał(a):
> sg wrote:
> 
>> 2. Is there any compiler for Ada under MacOS that is compatible with a
>> compiler for Linux and Windows.
> 
> Yes: GNAT. Start here:
> 
> http://en.wikibooks.org/wiki/Ada_Programming/Installing
> http://gnuada.sourceforge.net/
> https://libre2.adacore.com/
> 
> Martin

OK, but does that mean that I can use the special GNAT's pragmas and it 
will compile well under Windows, Linux and Mac ?

And what about the GNAT's licence, some time ago there was a huge 
discussion one the group about the new GNAT licence but as I haven't 
read the group for some time I don't know what is the conclusion: may I 
use GNAT for free for commercial products or not ?


regards
Szymon Guz



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 19:37   ` sg
@ 2006-02-02 21:30     ` Björn Persson
  2006-02-02 23:17       ` sg
  0 siblings, 1 reply; 27+ messages in thread
From: Björn Persson @ 2006-02-02 21:30 UTC (permalink / raw)


sg wrote:
> And what about the GNAT's licence, some time ago there was a huge 
> discussion one the group about the new GNAT licence but as I haven't 
> read the group for some time I don't know what is the conclusion: may I 
> use GNAT for free for commercial products or not ?

If you use Gnat GPL from AdaCore, and you distribute the program, then 
you must use the GPL. The program can still be commercial. Gnat itself 
is both commercial and free.

If you want to distribute the program with some other license than the 
GPL, whether it's another free license or an unfree license, then you 
can't use Gnat GPL. Use the Gnat that is part of GCC instead.

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 21:30     ` Björn Persson
@ 2006-02-02 23:17       ` sg
  2006-02-03  7:32         ` Jean-Pierre Rosen
                           ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: sg @ 2006-02-02 23:17 UTC (permalink / raw)


Björn Persson napisał(a):
> sg wrote:
>> And what about the GNAT's licence, some time ago there was a huge 
>> discussion one the group about the new GNAT licence but as I haven't 
>> read the group for some time I don't know what is the conclusion: may 
>> I use GNAT for free for commercial products or not ?
> 
> If you use Gnat GPL from AdaCore, and you distribute the program, then 
> you must use the GPL. The program can still be commercial. Gnat itself 
> is both commercial and free.
> 
> If you want to distribute the program with some other license than the 
> GPL, whether it's another free license or an unfree license, then you 
> can't use Gnat GPL. Use the Gnat that is part of GCC instead.
> 

OK but how with the compatibility of code compiled on Gnat that is part 
of GCC between MacOS, Windows and Linux ?

regards
Szymon Guz




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 23:17       ` sg
@ 2006-02-03  7:32         ` Jean-Pierre Rosen
  2006-02-03 19:38           ` Jeffrey R. Carter
  2006-02-03 16:27         ` Martin Krischik
  2006-02-03 23:55         ` Simon Williams
  2 siblings, 1 reply; 27+ messages in thread
From: Jean-Pierre Rosen @ 2006-02-03  7:32 UTC (permalink / raw)


sg a �crit :
  > OK but how with the compatibility of code compiled on Gnat that is part
> of GCC between MacOS, Windows and Linux ?
> 
Since you insist on the issue of differences between compilers, I see 
that you come from another world :-), therefore some clarification may 
be in order.

All Ada compilers (not only the various incantations of Gnat) compile 
*exactly* the same language. Full Stop.

Differences you may find are related to
- Places where the language purposedly defines things as "implementation 
dependent"

- Usage of some pragmas where the language allows them to be 
implementation defined.

- Differences in libraries.

For the first two, it is easy to simply avoid using the features. Ada 
was designed to *allow* benefitting from the peculiarities of a machine, 
  but the language is powerful enough to write almost anything without 
resorting to these.

For libraries (and especially GUI libraries like GTK), it is not a 
matter of compiler, it is a matter of... libraries. Simply choose a 
library that has been ported to the OSs you want to target.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 23:17       ` sg
  2006-02-03  7:32         ` Jean-Pierre Rosen
@ 2006-02-03 16:27         ` Martin Krischik
  2006-02-03 19:43           ` Jeffrey R. Carter
  2006-02-06  8:20           ` Maciej Sobczak
  2006-02-03 23:55         ` Simon Williams
  2 siblings, 2 replies; 27+ messages in thread
From: Martin Krischik @ 2006-02-03 16:27 UTC (permalink / raw)


sg 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.

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.

You see: we did not answer the question because we take compatibility as
God/Goddess given. Not something special at all. Why ask - its there.

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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-03  7:32         ` Jean-Pierre Rosen
@ 2006-02-03 19:38           ` Jeffrey R. Carter
  2006-02-06 10:15             ` Jean-Pierre Rosen
  0 siblings, 1 reply; 27+ messages in thread
From: Jeffrey R. Carter @ 2006-02-03 19:38 UTC (permalink / raw)


Jean-Pierre Rosen wrote:

> For libraries (and especially GUI libraries like GTK), it is not a 
> matter of compiler, it is a matter of... libraries. Simply choose a 
> library that has been ported to the OSs you want to target.

I haven't checked the latest version, but GtkAda relied on GNAT-specific features.

-- 
Jeff Carter
"Strange women lying in ponds distributing swords
is no basis for a system of government."
Monty Python & the Holy Grail
66



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-03 16:27         ` Martin Krischik
@ 2006-02-03 19:43           ` Jeffrey R. Carter
  2006-02-04  7:04             ` Martin Krischik
  2006-02-06  8:20           ` Maciej Sobczak
  1 sibling, 1 reply; 27+ messages in thread
From: Jeffrey R. Carter @ 2006-02-03 19:43 UTC (permalink / raw)


Martin Krischik wrote:

> 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.

I appreciate everything you're doing to promote Ada, but I wish you'd learn that 
the English word is "standard".

Thanks for letting me get that off my chest.

A company that did Ada validations (or whatever they're called now) also had a 
C++ validation suite. No "C++" compiler vendor ever asked to have its compiler 
validated, and no "C++" compiler they tested ever passed. I don't know if that's 
still true, but AFAIK you can't get a C++ compiler--that is, a compiler that 
implements the complete ISO-standard language.

-- 
Jeff Carter
"Strange women lying in ponds distributing swords
is no basis for a system of government."
Monty Python & the Holy Grail
66



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 23:17       ` sg
  2006-02-03  7:32         ` Jean-Pierre Rosen
  2006-02-03 16:27         ` Martin Krischik
@ 2006-02-03 23:55         ` Simon Williams
  2 siblings, 0 replies; 27+ messages in thread
From: Simon Williams @ 2006-02-03 23:55 UTC (permalink / raw)



I am the keeper of the macada.org website, and one of the maintainers
of the system for Macos x.  Gnat gcc works fine with Macosx.  I develop
and maintain gui and server programs for my work in gcc version of gnat
that we build/use/sell for both linux and macosx.  There is no
difference in code.  We use gtkada as our gui, and that works well for
us.  We have not done a windows port (though my boss keeps making
threats),  but in theory it should pretty much just work.  I did do a
partial port of the server several years ago and it came up and seemed
to work.  But i didnt have any customers so company wasn't interested
in paying to test etc then.  

if you have questions on the mac compatability on gnat check out the
gnat for mac mailing list at

http://hermes.gwu.edu/cgi-bin/wa?SUBED1=gnat-osx&A=1%22

best jim



In article <dru3u7$2fhj$1@node1.news.atman.pl>, sg
<alpha@skynet.org.pl_WITHOUT> wrote:

> OK but how with the compatibility of code compiled on Gnat that is part 
> of GCC between MacOS, Windows and Linux ?



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-03 19:43           ` Jeffrey R. Carter
@ 2006-02-04  7:04             ` Martin Krischik
  2006-02-04 14:32               ` Georg Bauhaus
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Krischik @ 2006-02-04  7:04 UTC (permalink / raw)


Jeffrey R. Carter wrote:

> Martin Krischik wrote:
> 
>> 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.
> 
> I appreciate everything you're doing to promote Ada, but I wish you'd
> learn that the English word is "standard".
> 
> Thanks for letting me get that off my chest.

Tricky: "standart" is German for "standard". See the problem?

> A company that did Ada validations (or whatever they're called now) also
> had a C++ validation suite. No "C++" compiler vendor ever asked to have
> its compiler validated, and no "C++" compiler they tested ever passed. I
> don't know if that's still true, but AFAIK you can't get a C++
> compiler--that is, a compiler that implements the complete ISO-standard
> language.

http://www.comeaucomputing.com they say they have all the features and they
are the only C++ compiler to implement "export". At least AFAIK. Of corse
all Ada genetics are export ;-).

Martin

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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-04  7:04             ` Martin Krischik
@ 2006-02-04 14:32               ` Georg Bauhaus
  0 siblings, 0 replies; 27+ messages in thread
From: Georg Bauhaus @ 2006-02-04 14:32 UTC (permalink / raw)


On Sat, 2006-02-04 at 08:04 +0100, Martin Krischik wrote:
> Jeffrey R. Carter wrote:
 
> > I appreciate everything you're doing to promote Ada, but I wish you'd
> > learn that the English word is "standard".

> Tricky: "standart" is German for "standard". See the problem?

No, the German word is not Standart, it is Standard, too.
Always has been, and the recent reform hasn't changed Standard.
"Standard" in the sense of a flag is "Standarte"
in German. Note that this word ends in 'e'.

For a pun, see
http://www.k-faktor.com/standart/


-- Georg 





^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  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-04 16:22 ` Adrian Hoe
  2006-02-04 16:25 ` Adrian Hoe
  3 siblings, 0 replies; 27+ messages in thread
From: Adrian Hoe @ 2006-02-04 16:22 UTC (permalink / raw)


Visit http://macada.org. This gnat integrate with xcode and the Apple's
Interface Builder with approriate plugin from macada will allow you to
develop Apple's native GUI applications. But then, it will not be
portable to WIndows and Linux. You can overcome this by using Darwin
X11 and Gtk (GtkAda) to develop your Mac applications.

There is a Gtk native port to Mac OS X somewhere (I can't remember the
url but google should give you some results). If this native port is
successful, developing cross-platform GUI will be even more pleasant on
Mac.

The xcode also have nice and convenient integration with Subversion and
other SCM. I have just configured my SVN to work with xcode.

gnat from macada does not support universal binary yet but soon.
--
Adrian Hoe
http://adrianhoe.net




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-02 10:53 Ada & MacOS sg
                   ` (2 preceding siblings ...)
  2006-02-04 16:22 ` Adrian Hoe
@ 2006-02-04 16:25 ` Adrian Hoe
  3 siblings, 0 replies; 27+ messages in thread
From: Adrian Hoe @ 2006-02-04 16:25 UTC (permalink / raw)


As for PostgreSQL, I haven't work on it yet. But I am working on MySQL
5 on Mac OS X and Linux and it is superb. Give it a try and you will
love it, who knows.
--
Adrian Hoe
http://adrianhoe.net




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-03 16:27         ` Martin Krischik
  2006-02-03 19:43           ` Jeffrey R. Carter
@ 2006-02-06  8:20           ` Maciej Sobczak
  2006-02-06 18:48             ` Jeffrey R. Carter
  2006-02-06 19:25             ` Martin Krischik
  1 sibling, 2 replies; 27+ messages in thread
From: Maciej Sobczak @ 2006-02-06  8:20 UTC (permalink / raw)


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?

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?

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.


-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-03 19:38           ` Jeffrey R. Carter
@ 2006-02-06 10:15             ` Jean-Pierre Rosen
  0 siblings, 0 replies; 27+ messages in thread
From: Jean-Pierre Rosen @ 2006-02-06 10:15 UTC (permalink / raw)


Jeffrey R. Carter a �crit :
> Jean-Pierre Rosen wrote:
> 
>> For libraries (and especially GUI libraries like GTK), it is not a 
>> matter of compiler, it is a matter of... libraries. Simply choose a 
>> library that has been ported to the OSs you want to target.
> 
> I haven't checked the latest version, but GtkAda relied on GNAT-specific 
> features.
> 
True, I use it with Gnat, but I think to remember that there was some 
effort to run it with Aonix. Anyone from Aonix listening?

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  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-06 19:25             ` Martin Krischik
  1 sibling, 2 replies; 27+ messages in thread
From: Jeffrey R. Carter @ 2006-02-06 18:48 UTC (permalink / raw)


Maciej Sobczak wrote:

> 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?

Using which compilers and what language features? Very few "C++" compilers 
implement the language defined by the ISO standard. Can you use all the features 
of the standard language and count on it compiling with all "C++" compilers?

With Ada, the entire standard language is compiled by every compiler; a compiler 
that didn't implement, say, generics, would be laughed out of existence. Yet 
"C++" users regularly use compilers that don't implement templates, exceptions, 
or namespaces.

Sure, Ada compilers are large programs and have errors. They're less common than 
back in the good old days when it seems I broke a compiler every time I turned 
around.

Ada compilers can implement compiler-dependent pragmas and attributes, and can 
supply compiler-dependent packages. Many also supply platform-dependent 
packages. If you use those, you're not writing portable code. If you stick to 
the standard language, though, portability is pretty much guaranteed.

GNAT is an interesting beast. Versions exist for a number of platforms, and it 
comes with a large library (GNAT.*) that is compiler dependent, and much of it 
(such as GNAT.OS_Lib) seems platform dependent, too. These work fine on all 
platforms that GNAT compiles to. So you have compiler-dependent but 
platform-independent packages with GNAT.

-- 
Jeff Carter
"Ada has made you lazy and careless. You can write programs in C that
are just as safe by the simple application of super-human diligence."
E. Robert Tisdale
72



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-06  8:20           ` Maciej Sobczak
  2006-02-06 18:48             ` Jeffrey R. Carter
@ 2006-02-06 19:25             ` Martin Krischik
  2006-02-06 20:34               ` Hyman Rosen
  1 sibling, 1 reply; 27+ messages in thread
From: Martin Krischik @ 2006-02-06 19:25 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-06 19:25             ` Martin Krischik
@ 2006-02-06 20:34               ` Hyman Rosen
  2006-02-07 16:13                 ` Martin Krischik
  0 siblings, 1 reply; 27+ messages in thread
From: Hyman Rosen @ 2006-02-06 20:34 UTC (permalink / raw)


Martin Krischik wrote:
> unsigned& key (int& x)  { return x; }

Here's what a modern C++ compiler says:
Comeau C/C++ 4.3.3 (Aug  6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing.  All rights reserved.
MODE:strict errors C++

"ComeauTest.c", line 4: error: a reference of type "unsigned int &"
(not
          const-qualified) cannot be initialized with a value of type
"int"
    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.

The same compiler as above, with a template:
"ComeauTest.c", line 2: error: a reference of type "int &" (not
const-qualified)
          cannot be initialized with a value of type "unsigned int"
  R &key (P &x) { return x; }
                         ^
          detected during instantiation of
                    "R &key<R,P>(P &) [with R=int, P=unsigned int]"

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

Neither, of course.

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

The place to ask is comp.lang.c++.moderated or comp.std.c++ (the
unmoderated
groups are too noisy - c.l.a should have such problems!)

> 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 ....

I assure you, in either of those groups I mention, you will have
Standard C++
quoted at you chapter and verse to your heart's content, and quickly
too.




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-06 18:48             ` Jeffrey R. Carter
@ 2006-02-06 20:44               ` Hyman Rosen
  2006-02-07  9:10               ` Maciej Sobczak
  1 sibling, 0 replies; 27+ messages in thread
From: Hyman Rosen @ 2006-02-06 20:44 UTC (permalink / raw)


Jeffrey R. Carter wrote:
> Using which compilers and what language features? Very few "C++" compilers
> implement the language defined by the ISO standard. Can you use all the features
> of the standard language and count on it compiling with all "C++" compilers?

Much more so now than in the past. The biggest missing feature is
implementation of the "export" keyword, and that's more due to
deliberate foot-dragging than anything else, by vendors who loathe
the feature. There are also legacy features that remain in some
implementations that would not be there in a completely conforming
compiler. But you now have to be quite expert in C++ to find the
missing features in modern compilers.

> Ada compilers can implement compiler-dependent pragmas and attributes, and can
> supply compiler-dependent packages. Many also supply platform-dependent
> packages. If you use those, you're not writing portable code. If you stick to
> the standard language, though, portability is pretty much guaranteed.

What about all the standard annexes which vendors may choose not to
implement? If I write a standard-conforming distributed program in Ada,
is portability pretty much guaranteed?




^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  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
  1 sibling, 2 replies; 27+ messages in thread
From: Maciej Sobczak @ 2006-02-07  9:10 UTC (permalink / raw)


Jeffrey R. Carter wrote:

>> 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?
> 
> Using which compilers and what language features? Very few "C++" 
> compilers implement the language defined by the ISO standard.

You may find it funny, but since nobody implements the "export" feature, 
then nobody uses it, and then in turn it's not a problem that nobody 
implements it. Similarly, you will not find this feature described in 
beginner's books, nor lectured in courses. For this reason, the one 
compiler which claims to support this feature did not get immediate 
market advantage exactly because there's no code (and no programmers - 
not counting few die-hard enthusiasts) that would benefit from this. And 
for the same reason, other vendors don't rush to implement it.
So, no, I cannot use *all* the ISO features, but since I'm not using 
them anyway, I don't find it to be a showstopper. There is a bunch of 
good compilers targetting most of the platforms I'm interested in and I 
don't find any problems moving my code from one platform to another.

> With Ada, the entire standard language is compiled by every compiler; a 
> compiler that didn't implement, say, generics, would be laughed out of 
> existence. Yet "C++" users regularly use compilers that don't implement 
> templates, exceptions, or namespaces.

Really? Taking into account what I've seen during the last few years on 
comp.lang.c++.moderated, I'd say that today such compilers are 
extraordinarily rare, something like a living mammoth. I don't call it 
"regularly use".

> Ada compilers can implement compiler-dependent pragmas and attributes, 
> and can supply compiler-dependent packages. Many also supply 
> platform-dependent packages. If you use those, you're not writing 
> portable code. If you stick to the standard language, though, 
> portability is pretty much guaranteed.

Yes, sure. Same for C++ - stick to the standard library and you're done. 
The problem is that both Ada and C++ have *very* small standard 
libraries, especially when compared to what you can get from Java or 
.NET stuff. This means that apart from reading from and writing to 
files, there's not much the fully compliant program can do. Not counting 
some extremely encapsulated environments (like embedded), every 
application needs to rely on some non-standard library. Network? GUI? 
XML? Databases? <your-pet-application-area-here>? Say I want to write a 
mail client in Ada - obviously some network and GUI stuff would be 
needed. Then what? Of course, I can use some non-standard library(ies) 
for this. But since the library is non-standard, it does not fall under 
the "we have a standard test suite" label, so the foundation to boast 
unprecedented portability is no longer there.

I'm writing this from Mozilla, written in C++, running happily on most 
desktop platforms you can find today. Have Mozilla been written in Ada, 
it wouldn't be much more portable.

> GNAT is an interesting beast. Versions exist for a number of platforms, 
> and it comes with a large library (GNAT.*) that is compiler dependent, 
> and much of it (such as GNAT.OS_Lib) seems platform dependent, too. 
> These work fine on all platforms that GNAT compiles to. So you have 
> compiler-dependent but platform-independent packages with GNAT.

In C++ there are libraries, which are platform-independent and 
compiler-independent as well (see for example www.boost.org). The 
portability achieved with those libraries is very high.

BTW - why do you write "C++" in question marks, and Ada without them?

-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-06 20:34               ` Hyman Rosen
@ 2006-02-07 16:13                 ` Martin Krischik
  0 siblings, 0 replies; 27+ messages in thread
From: Martin Krischik @ 2006-02-07 16:13 UTC (permalink / raw)


Hyman Rosen wrote:

>> 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.
> 
> The same compiler as above, with a template:
> "ComeauTest.c", line 2: error: a reference of type "int &" (not
> const-qualified)
> cannot be initialized with a value of type "unsigned int"
> R &key (P &x) { return x; }
> ^
> detected during instantiation of
> "R &key<R,P>(P &) [with R=int, P=unsigned int]"

Then there is hope for C++ after all - at least one compiler which gets it
right.

>> But how about a little quiz: Which of the two compiler in question where
>> right?
 
> Neither, of course.

Well then we know what IBM C++ (3.08) and MS C++ (Studio.NET) have in
common ;-) .

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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-07  9:10               ` Maciej Sobczak
@ 2006-02-07 16:16                 ` Martin Krischik
  2006-02-08  4:51                 ` Jeffrey R. Carter
  1 sibling, 0 replies; 27+ messages in thread
From: Martin Krischik @ 2006-02-07 16:16 UTC (permalink / raw)


Maciej Sobczak wrote:

> BTW - why do you write "C++" in question marks, and Ada without them?

I would guess that "C++" is for compilers which don't deserve the name C++ -
that is: They don't even try to fullfill the full standart. I only know of
to who honestly try (GCC and Comeau C/C++) and only one who seems
successfull (the later, GCC is still missing export).

If you know another I like to know.

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



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  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
  1 sibling, 2 replies; 27+ messages in thread
From: Jeffrey R. Carter @ 2006-02-08  4:51 UTC (permalink / raw)


Maciej Sobczak wrote:

>> With Ada, the entire standard language is compiled by every compiler; 
>> a compiler that didn't implement, say, generics, would be laughed out 
>> of existence. Yet "C++" users regularly use compilers that don't 
>> implement templates, exceptions, or namespaces.
> 
> Really? Taking into account what I've seen during the last few years on 
> comp.lang.c++.moderated, I'd say that today such compilers are 
> extraordinarily rare, something like a living mammoth. I don't call it 
> "regularly use".
 >
> I'm writing this from Mozilla, written in C++, running happily on most 
> desktop platforms you can find today. Have Mozilla been written in Ada, 
> it wouldn't be much more portable.

Interesting that you mention Mozilla. Take a look at their rules for writing C++ 
for the project:

http://www.mozilla.org/hacking/portable-cpp.html

Lots of things you can't use, including no templates (a few exceptions), no 
exceptions, no namespaces. That's for contributing to Mozilla today, because so 
many of the compilers used to build Mozilla for various platforms today don't 
support these basic features of the language.

> BTW - why do you write "C++" in question marks, and Ada without them?

C++ is an ISO standard; anything that isn't the language defined in that 
standard isn't C++. Lots of people use the name "C++" to refer to things that 
aren't C++; I use "C++" to refer to such things.

By the way, '"' is a quotation mark; '?' is a question mark.

-- 
Jeff Carter
"You tiny-brained wipers of other people's bottoms!"
Monty Python & the Holy Grail
18



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-08  4:51                 ` Jeffrey R. Carter
@ 2006-02-08  7:35                   ` Alex R. Mosteo
  2006-02-09 14:52                   ` Maciej Sobczak
  1 sibling, 0 replies; 27+ messages in thread
From: Alex R. Mosteo @ 2006-02-08  7:35 UTC (permalink / raw)


Jeffrey R. Carter wrote:
> Maciej Sobczak wrote:

>> I'm writing this from Mozilla, written in C++, running happily on most 
>> desktop platforms you can find today. Have Mozilla been written in 
>> Ada, it wouldn't be much more portable.
> 
> 
> Interesting that you mention Mozilla. Take a look at their rules for 
> writing C++ for the project:
> 
> http://www.mozilla.org/hacking/portable-cpp.html
> 
> Lots of things you can't use, including no templates (a few exceptions), 
> no exceptions, no namespaces. That's for contributing to Mozilla today, 
> because so many of the compilers used to build Mozilla for various 
> platforms today don't support these basic features of the language.

An interesting quote from the link is "But this is the reality of 
portable code" (which obviously must be understood as the reality of 
portable "C++").

One of the things that triggered my interest in Ada in my college days 
was that I had to work in a HP-UX at the labs, but could also work in my 
home linux (we also had meridian Ada for ms-dos in another lab). And 
never had an issue with portability. A different beast was trying to use 
the HP-UX CC and linux gcc at the same time. I remember special fun with 
templates, which have the extra amusing property of triggering dozens of 
errors but only at link time. (Really, how I hate link time errors.)



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Ada & MacOS
  2006-02-08  4:51                 ` Jeffrey R. Carter
  2006-02-08  7:35                   ` Alex R. Mosteo
@ 2006-02-09 14:52                   ` Maciej Sobczak
  1 sibling, 0 replies; 27+ messages in thread
From: Maciej Sobczak @ 2006-02-09 14:52 UTC (permalink / raw)


Jeffrey R. Carter wrote:

> Interesting that you mention Mozilla. Take a look at their rules for 
> writing C++ for the project:
> 
> http://www.mozilla.org/hacking/portable-cpp.html
> 
> Lots of things you can't use

That's interesting, especially taking into account that all of the 
platforms for which they provide downloadable binaries can be targeted 
with just two or three recent versions of GCC. Plus VC++ for Windows.
All of these compilers support the forbidden features. I cannot comment 
on these rules, because I don't really know when they were last updated 
and what is the actual list of compilers that they use.

It might be also good to point out one thing - different projects (or 
even application areas) impose different guidelines and restrictions on 
the set of allowed language features, even without taking the 
portability under consideration, sometimes just to retain some given 
style or control over the design - when the language is powerful enough, 
it might turn out to be too powerful. Such guidelines and restrictions 
are in use *also* with Ada - Ravenscar is a good example - but nobody 
will claim here that Ada is a bad language. In general, the fact that 
some project (company, application area, etc.) uses any given set of 
restrictions does not indicate that the language is broken.


>> BTW - why do you write "C++" in question marks, and Ada without them?
> 
> C++ is an ISO standard; anything that isn't the language defined in that 
> standard isn't C++. Lots of people use the name "C++" to refer to things 
> that aren't C++; I use "C++" to refer to such things.

OK, I see. I understand then, that the code which is fully 
standard-compliant can be called C++ even if it's compiled with the 
compiler that does not support 100% of the standard? I call my code C++ 
then.

> By the way, '"' is a quotation mark; '?' is a question mark.

Sure. Mindless typo. :)


-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2006-02-09 14:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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