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,59d666bca086a225 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeed.inode.at!news.hispeed.ch!linux2.krischik.com!news From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Ada & MacOS Date: Mon, 06 Feb 2006 20:25:21 +0100 Organization: Cablecom Newsserver Message-ID: <4047936.ucMNu27ket@linux1.krischik.com> References: <1776691.hMkAr8ZQHy@linux1.krischik.com> <6SuEf.155126$dP1.513381@newsc.telia.net> <1289921.BRApYLEfLn@linux1.krischik.com> NNTP-Posting-Host: 84-74-134-212.dclient.hispeed.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.hispeed.ch 1139256032 1209 84.74.134.212 (6 Feb 2006 20:00:32 GMT) X-Complaints-To: news@hispeed.ch NNTP-Posting-Date: Mon, 6 Feb 2006 20:00:32 +0000 (UTC) User-Agent: KNode/0.10 Xref: g2news1.google.com comp.lang.ada:2800 Date: 2006-02-06T20:25:21+01:00 List-Id: 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 (x); while the other sought it would be more fun to do: return static_cast (x); Wonder what the difference is? Well the 2nd option expands to: auto unsigned temp = static_cast (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