From: Marin David Condic <nobody@noplace.com>
Subject: Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?)
Date: Thu, 22 Jan 2004 12:47:28 GMT
Date: 2004-01-22T12:47:28+00:00 [thread overview]
Message-ID: <400FC65B.2020006@noplace.com> (raw)
In-Reply-To: LNOdncWFbKUojpLdRVn-uQ@comcast.com
O.K., but three things.
1) With it being an enumeral, unless *ALL* implementations use the same
ones, I have code that won't compile, right? Assuming Aonix doesn't have
an enumeral like: SYSTEM_NAME_GNAT then I clearly can't write "if
(SYSTEM_NAME_GNAT) then...". A character string would be more usable in
this regard, but then you still need to have some useful set of
character strings. This is probably the primary reason it isn't used -
its totally useless for any sort of portability concern. The code works
so long as its the Gnat compiler doing it, but it doesn't work (or even
compile) for Aonix or something else, right? So I might just as well not
have had the conditional statements in there in the first place because
it didn't work to begin with and it didn't work just as nicely with the
"if" statement wrapped around it. It would also be totally unreasonable
to expect that all vendors would pick up all other vendor's enumeral
sets to make sure it was portable at least at the compilation level.
2) No matter what I do, I can't use this in a *declaration*. Earlier
versions of Gnat (for the PC - it wasn't supported on the Alpha and
maybe not for others) would support a 96 bit float. Now that has become
a 128 bit float. (My guess is that they both held an IEEE 80 bit float,
but I never checked that far.) So I'd like some capability to say
something like:
if (System.Name = "GNAT v12.something") then
type X is new Float_96 ;
for X'Size use 96 ;
elsif (System.Name = "GNAT v15.something") then
type X is new Float_128 ;
for X'Size use 128 ;
end if ;
This may be a trivial example that could probably be better done with
something like System.Max_Digits, but that doesn't mean there are not
more complicated and difficult cases that just plain can't be handled
with the current setup.
3) Even in executable parts of the code, this doesn't get you around a
problem where one compiler/target will support a given statement and
another compiler/target will not. Suppose you had some compiler/target
dependent package available to you - GNAT.Something. In a different
compiler/target, you have a similar package - AONIX.SomethingElse. You'd
like (at some low level of isolation) to build a skin over this by
withing the appropriate package and making the appropriate call.
Something like:
if (System.Name = "GNAT") then
with GNAT.Something ;
elsif (System.Name = "AONIX") then
with AONIX.SomethingElse ;
end if ;
package Isolation_Skin is
procedure Do_The_Thing is
begin
if (System.Name = "GNAT") then
GNAT.Something.Do_It_The_GNAT_Way ;
elsif (System.Name = "AONIX") then
AONIX.SomethingElse.Do_It_The_AONIX_Way ;
end if ;
end Do_The_Thing ;
end Isolation_Skin ;
Under the current system, I can't pull the "with" trick part, but the
idea is that the statement: AONIX.SomethingElse.Do_It_The_AONIX_Way may
not even be compilable in the Gnat environment. There are plenty of
"implementation defined" or "implementation dependent" features of Ada -
not to mention compiler bugs, etc., that would make sure that a given
body of code might not compile for an implementation, so a simple "if"
statement can't get you around it. It must be pre-processed in some
manner to effectively comment out the branches that don't work.
Granted, you can create two package bodies and isolate it down at that
point, but then you've got to configuration manage and build with two
bodies. Ada has no "Standard" configuration management or build tools
built in to handle this so you get no guarantee from the language that
you could provide some kind of build script or whatever to do it. (Hence
why developers tend to like some kind of conditional compilation. Its
the only way you can *guarantee* that you have a mechanism of getting
your code to work on two different platforms.)
BTW: I have no hesitation to dip into the package System when I've got
to do something system dependent - referencing addresses, etc. For
PC/Workstation apps, this isn't that often, but in the embedded world
its absolutely critical. Naturally, you try to isolate these
dependencies down at some low level so they don't intersperse all
throughout the code and make porting a more difficult job, but there
should be no reason to hesitate to use System when there is some system
dependent feature you need. So at least in *my* individual little Ada
culture, there is no phobia about it. :-)
MDC
Robert I. Eachus wrote:
>
> Technically what we expected way back when was that users would write
> code that depended on the value of System.System_Name, which was made an
> Ada constant for just that reason. (Compilers could evaluate "if
> System.System_Name = VAX then..." at compile time to eliminate any
> overhead.)
>
> In practice, two things prevented that. First, vendors didn't list all
> supported systems in package System, usually just the one you were
> compiling for. But more important was that the Ada culture quickly
> became to avoid dependencies on System for any reason whatsoever.
>
> Now, we are where we are:
>
> -----------------------------------------------------------
> with Ada.Text_IO; use Ada.Text_IO;
> with System; use System;
> procedure System_Names is
> package Name_IO is new Enumeration_IO(System.Name);
> begin
> Put(" The Available System Names are: ");
> for I in System.Name'Range loop
> Name_IO.Put(I);
> if I = System.Name'Last
> then
> Put_Line(".");
> else
> Put(", ");
> if Col > 60 then New_Line; end if;
> end if;
> end loop;
> New_Line;
> Put(" Current System.System_Name is: ");
> Name_IO.Put(System.System_Name);
> Put_Line(".");
> end System_Names;
> -----------------------------------------------------------
>
> E:\Ada\Test>system_names
> system_names
> The Available System Names are: SYSTEM_NAME_GNAT.
>
> Current System.System_Name is: SYSTEM_NAME_GNAT.
>
> Is there any compiler that produces a useful output? Of course, with
> GNAT at least I can modify system and recompile it. But of course, the
> usual is to do the easier thing, and have some other system dependent
> package defined by the project will all the dependencies depending on
> that. But that forces projects to do the version control that should
> come from the compiler switches. (The code generator has to know enough
> about the target to patch up System. But for that to work the type
> System.Name has to contain a useful set of names.)
>
> Incidently this is the first program I have written in a while that had
> a bug not caught by the compiler. For some reason Are was capitalized
> in one of the message strings. ;-)
>
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm
Send Replies To: m o d c @ a m o g
c n i c . r
"Face it ladies, its not the dress that makes you look fat.
Its the FAT that makes you look fat."
-- Al Bundy
======================================================================
next prev parent reply other threads:[~2004-01-22 12:47 UTC|newest]
Thread overview: 296+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-17 11:15 why ada is so unpopular ? Szymon Guz
2004-01-17 13:53 ` Martin Dowie
2004-01-17 14:27 ` Dmytry Lavrov
2004-01-17 21:02 ` Szymon Guz
2004-01-17 22:36 ` Adrian Knoth
2004-01-18 9:21 ` Szymon Guz
2004-01-18 12:18 ` Luke A. Guest
2004-01-18 13:09 ` Ronald Dauster
2004-01-18 12:59 ` Ronald Dauster
2004-01-18 13:25 ` Stephane Richard
2004-01-18 14:17 ` Szymon Guz
2004-01-18 14:42 ` Marin David Condic
2004-01-18 15:23 ` Szymon Guz
2004-01-18 17:53 ` Jeffrey Carter
2004-01-18 16:34 ` Preben Randhol
2004-01-19 12:59 ` Marin David Condic
2004-01-19 13:06 ` Preben Randhol
2004-01-19 13:28 ` Marin David Condic
2004-01-19 13:37 ` Preben Randhol
2004-01-20 12:38 ` Marin David Condic
2004-01-20 17:31 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Warren W. Gay VE3WWG
2004-01-20 18:50 ` Standard Ada Preprocessor Georg Bauhaus
2004-01-26 4:00 ` Peter Richtmyer
2004-01-26 5:01 ` tmoran
2004-01-26 12:01 ` Marin David Condic
2004-02-01 15:09 ` Mark
2004-02-01 19:10 ` Frank J. Lhota
2004-02-02 16:48 ` Martin Krischik
2004-02-02 18:22 ` Frank J. Lhota
2004-01-21 12:39 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Marin David Condic
2004-01-21 13:12 ` Standard Ada Preprocessor Georg Bauhaus
2004-01-22 0:05 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Robert I. Eachus
2004-01-22 5:59 ` Randy Brukardt
2004-01-22 12:58 ` Marin David Condic
2004-01-22 17:25 ` Warren W. Gay VE3WWG
2004-01-23 12:24 ` Marin David Condic
2004-01-23 13:46 ` Dmitry A. Kazakov
2004-01-23 17:16 ` Warren W. Gay VE3WWG
2004-01-23 17:52 ` Jeffrey Carter
2004-01-23 21:57 ` Warren W. Gay VE3WWG
2004-01-24 0:52 ` Jeffrey Carter
2004-01-26 17:19 ` Warren W. Gay VE3WWG
2004-01-27 12:24 ` Marin David Condic
2004-01-27 19:03 ` Standard Ada Preprocessor Georg Bauhaus
2004-01-24 1:34 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Marin David Condic
2004-01-26 17:27 ` Warren W. Gay VE3WWG
2004-01-27 12:30 ` Marin David Condic
2004-01-24 8:20 ` Pascal Obry
2004-01-26 17:29 ` Warren W. Gay VE3WWG
2004-01-23 17:56 ` Larry Hazel
2004-01-24 1:36 ` Marin David Condic
2004-01-23 22:14 ` Randy Brukardt
2004-01-23 22:42 ` tmoran
2004-01-26 17:50 ` Warren W. Gay VE3WWG
2004-01-26 18:54 ` Standard Ada Preprocessor Jeffrey Carter
2004-01-26 21:53 ` Warren W. Gay VE3WWG
2004-01-27 0:00 ` Robert I. Eachus
2004-01-27 17:30 ` Warren W. Gay VE3WWG
2004-01-27 20:55 ` Robert A Duff
2004-01-27 22:03 ` Robert I. Eachus
2004-01-28 12:28 ` Marin David Condic
2004-01-28 20:55 ` Simon Wright
2004-01-29 12:40 ` Marin David Condic
2004-01-29 18:08 ` Jeffrey Carter
2004-01-30 12:30 ` Marin David Condic
2004-01-29 20:45 ` Simon Wright
2004-01-29 23:12 ` Randy Brukardt
2004-01-30 13:09 ` Marin David Condic
2004-01-30 18:06 ` Jeffrey Carter
2004-01-31 8:11 ` Marin David Condic
2004-01-30 12:36 ` Marin David Condic
2004-01-30 16:52 ` Pascal Obry
2004-01-31 8:25 ` Marin David Condic
2004-01-27 21:04 ` Randy Brukardt
2004-01-28 12:42 ` Marin David Condic
2004-01-27 12:48 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Marin David Condic
2004-01-26 9:34 ` Dmitry A. Kazakov
2004-01-26 19:23 ` Randy Brukardt
2004-01-23 2:47 ` Robert I. Eachus
2004-01-23 12:38 ` Marin David Condic
2004-01-24 5:23 ` Robert I. Eachus
2004-01-24 12:28 ` Marin David Condic
2004-01-24 15:32 ` Robert I. Eachus
2004-01-24 15:43 ` Marin David Condic
2004-01-25 4:24 ` Robert I. Eachus
2004-01-25 16:24 ` Marin David Condic
2004-01-29 11:17 ` Jacob Sparre Andersen
2004-01-29 12:52 ` Marin David Condic
2004-01-26 18:03 ` Warren W. Gay VE3WWG
2004-01-26 19:14 ` Standard Ada Preprocessor Jeffrey Carter
2004-01-26 22:04 ` Warren W. Gay VE3WWG
2004-01-27 1:00 ` Jeffrey Carter
2004-01-27 8:35 ` Ole-Hjalmar Kristensen
2004-01-27 11:09 ` Georg Bauhaus
2004-01-27 15:22 ` Ole-Hjalmar Kristensen
2004-01-27 15:54 ` Robert I. Eachus
2004-01-27 18:00 ` Warren W. Gay VE3WWG
2004-01-27 19:19 ` David Starner
2004-01-27 20:08 ` Ludovic Brenta
2004-01-27 20:19 ` Georg Bauhaus
2004-01-27 20:58 ` Randy Brukardt
2004-01-27 22:13 ` Simon Wright
2004-01-27 23:04 ` David Starner
2004-01-28 1:41 ` Jeffrey Carter
2004-01-28 2:26 ` Georg Bauhaus
2004-01-28 2:50 ` Stephen Leake
2004-01-28 3:21 ` Jeff C,
2004-01-28 3:57 ` David Starner
2004-01-29 3:03 ` Stephen Leake
2004-01-29 7:20 ` David Starner
2004-01-29 11:14 ` Georg Bauhaus
2004-01-29 18:56 ` David Starner
2004-01-29 19:41 ` Georg Bauhaus
2004-01-29 12:57 ` Marin David Condic
2004-01-29 13:51 ` Preben Randhol
2004-01-30 2:46 ` Robert I. Eachus
2004-01-28 20:34 ` Michael Bode
2004-01-29 3:06 ` Stephen Leake
2004-01-28 12:50 ` Marin David Condic
2004-01-27 20:44 ` Randy Brukardt
2004-01-27 22:15 ` Alexandre E. Kopilovitch
2004-01-29 17:31 ` Standard Ada Preprocessor (conclusions) Warren W. Gay VE3WWG
2004-01-29 19:44 ` Georg Bauhaus
2004-01-30 13:25 ` Marin David Condic
2004-01-30 13:29 ` Lutz Donnerhacke
2004-01-30 13:53 ` Marin David Condic
2004-01-30 14:14 ` Lutz Donnerhacke
2004-01-27 19:11 ` Standard Ada Preprocessor Jeffrey Carter
2004-01-27 21:48 ` Alexandre E. Kopilovitch
2004-01-28 16:26 ` Robert I. Eachus
2004-01-29 2:51 ` Alexandre E. Kopilovitch
2004-01-29 11:19 ` Georg Bauhaus
2004-01-29 22:02 ` Nature of XML (was: Re: Standard Ada Preprocessor) Alexandre E. Kopilovitch
2004-01-30 8:53 ` Preben Randhol
2004-01-30 17:35 ` Alexandre E. Kopilovitch
2004-01-30 19:13 ` Preben Randhol
2004-01-31 16:04 ` Alexandre E. Kopilovitch
2004-01-31 16:45 ` Preben Randhol
2004-01-30 18:49 ` Nature of XML Georg Bauhaus
2004-01-30 19:16 ` Marius Amado Alves
2004-01-30 22:59 ` Georg Bauhaus
2004-01-31 1:26 ` Robert I. Eachus
2004-01-31 13:08 ` Nature of XML (ramblings) Marius Amado Alves
2004-01-31 18:14 ` Georg Bauhaus
2004-02-03 1:35 ` Nature of XML Robert C. Leif
2004-02-03 14:23 ` Georg Bauhaus
2004-01-27 17:50 ` Standard Ada Preprocessor Warren W. Gay VE3WWG
2004-01-27 20:42 ` Randy Brukardt
2004-01-27 21:41 ` Warren W. Gay VE3WWG
2004-01-28 9:10 ` Dmitry A. Kazakov
2004-01-29 17:39 ` Warren W. Gay VE3WWG
2004-01-28 23:21 ` Randy Brukardt
2004-01-29 17:46 ` Warren W. Gay VE3WWG
2004-01-30 3:20 ` Robert I. Eachus
2004-01-28 12:27 ` Ole-Hjalmar Kristensen
2004-01-29 17:53 ` Warren W. Gay VE3WWG
2004-01-27 17:33 ` Warren W. Gay VE3WWG
2004-01-27 19:07 ` Jeffrey Carter
2004-01-27 21:42 ` Warren W. Gay VE3WWG
2004-01-27 2:35 ` Randy Brukardt
2004-01-27 21:47 ` Warren W. Gay VE3WWG
2004-01-28 1:19 ` Jeffrey Carter
2004-01-28 12:30 ` Ole-Hjalmar Kristensen
2004-01-28 23:35 ` Randy Brukardt
2004-01-29 10:16 ` Ole-Hjalmar Kristensen
2004-01-29 17:58 ` Warren W. Gay VE3WWG
2004-01-29 23:19 ` Randy Brukardt
2004-01-27 3:54 ` Jeffrey Carter
2004-01-27 21:53 ` Warren W. Gay VE3WWG
2004-01-28 1:27 ` Jeffrey Carter
2004-01-29 18:02 ` Warren W. Gay VE3WWG
2004-01-28 20:35 ` Pascal Obry
2004-01-29 0:53 ` Jeffrey Carter
2004-01-28 23:41 ` Randy Brukardt
2004-01-29 18:04 ` Warren W. Gay VE3WWG
2004-01-30 2:33 ` Chad R. Meiners
2004-01-30 18:00 ` Warren W. Gay VE3WWG
2004-01-30 22:52 ` Blinking text Chad R. Meiners
2004-02-06 17:14 ` Warren W. Gay VE3WWG
2004-01-27 7:41 ` Standard Ada Preprocessor Pascal Obry
2004-01-27 21:53 ` Warren W. Gay VE3WWG
2004-01-27 0:06 ` Robert I. Eachus
2004-01-27 21:55 ` Warren W. Gay VE3WWG
2004-01-28 1:34 ` Jeffrey Carter
2004-01-30 17:19 ` Warren W. Gay VE3WWG
2004-01-30 19:06 ` Frank J. Lhota
2004-02-10 11:18 ` stephen.freeman9
2004-02-10 17:45 ` Language Design (was Standard Ada Preprocessor) Warren W. Gay VE3WWG
2004-01-27 0:17 ` Standard Ada Preprocessor Alexandre E. Kopilovitch
2004-01-26 23:44 ` Georg Bauhaus
2004-01-27 22:04 ` Warren W. Gay VE3WWG
2004-01-28 2:47 ` Georg Bauhaus
2004-01-30 17:29 ` Warren W. Gay VE3WWG
2004-01-30 19:06 ` Georg Bauhaus
2004-01-31 8:42 ` Marin David Condic
2004-02-02 17:28 ` Warren W. Gay VE3WWG
2004-01-27 0:15 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Robert I. Eachus
2004-01-27 22:05 ` Warren W. Gay VE3WWG
2004-01-24 8:17 ` Pascal Obry
2004-01-24 12:44 ` Marin David Condic
2004-01-24 15:39 ` Robert I. Eachus
2004-01-24 16:06 ` Marin David Condic
2004-01-26 11:28 ` Ole-Hjalmar Kristensen
2004-01-26 12:07 ` Marin David Condic
2004-01-23 16:38 ` Alexandre E. Kopilovitch
2004-01-23 17:54 ` Jeffrey Carter
2004-01-23 17:24 ` Warren W. Gay VE3WWG
2004-01-23 22:30 ` Randy Brukardt
2004-01-26 22:11 ` Warren W. Gay VE3WWG
2004-01-27 0:28 ` Robert I. Eachus
2004-01-27 22:13 ` Warren W. Gay VE3WWG
2004-01-27 1:02 ` Jeffrey Carter
2004-01-22 14:13 ` Robert A Duff
2004-01-22 17:27 ` Warren W. Gay VE3WWG
2004-01-23 12:54 ` Marin David Condic
2004-01-23 17:26 ` Warren W. Gay VE3WWG
2004-01-23 12:52 ` Marin David Condic
2004-01-24 5:52 ` Robert I. Eachus
2004-01-24 12:56 ` Marin David Condic
2004-01-24 15:53 ` Robert I. Eachus
2004-01-30 17:39 ` Warren W. Gay VE3WWG
2004-01-31 1:58 ` Robert I. Eachus
2004-02-02 17:55 ` Warren W. Gay VE3WWG
2004-02-04 18:36 ` Robert I. Eachus
2004-02-06 17:27 ` Warren W. Gay VE3WWG
2004-02-07 13:18 ` Marin David Condic
2004-02-09 17:37 ` Warren W. Gay VE3WWG
2004-02-10 14:59 ` Standard Ada Preprocessor Jacob Sparre Andersen
2004-02-10 17:57 ` Warren W. Gay VE3WWG
2004-02-10 21:49 ` Jacob Sparre Andersen
2004-02-11 8:34 ` Dmitry A. Kazakov
2004-02-13 17:27 ` Warren W. Gay VE3WWG
2004-01-30 17:34 ` Standard Ada Preprocessor (Was: why ada is so unpopular ?) Warren W. Gay VE3WWG
2004-01-22 12:47 ` Marin David Condic [this message]
2004-01-22 13:24 ` Jean-Pierre Rosen
2004-01-22 18:20 ` Robert A Duff
2004-01-23 9:18 ` Jean-Pierre Rosen
2004-01-23 12:59 ` Marin David Condic
2004-01-23 14:21 ` Jean-Pierre Rosen
2004-01-24 6:02 ` Robert I. Eachus
2004-01-24 13:09 ` Marin David Condic
2004-01-24 19:32 ` tmoran
2004-01-24 20:34 ` Marin David Condic
2004-01-22 17:29 ` Warren W. Gay VE3WWG
2004-01-22 13:19 ` Standard Ada Preprocessor Georg Bauhaus
2004-01-22 13:49 ` Marin David Condic
2004-01-22 15:03 ` Georg Bauhaus
2004-01-22 17:33 ` Warren W. Gay VE3WWG
2004-01-22 19:02 ` Georg Bauhaus
2004-01-23 17:35 ` Warren W. Gay VE3WWG
2004-01-24 1:50 ` Marin David Condic
2004-01-24 5:33 ` Randy Brukardt
2004-01-24 13:28 ` Marin David Condic
2004-01-24 15:58 ` Robert I. Eachus
2004-01-24 16:11 ` Marin David Condic
2004-01-24 19:32 ` tmoran
2004-01-24 20:44 ` Marin David Condic
2004-01-25 5:02 ` Robert I. Eachus
2004-01-25 16:38 ` Marin David Condic
2004-01-26 16:03 ` Robert I. Eachus
2004-01-24 23:39 ` Randy Brukardt
2004-01-25 13:47 ` Stephane Richard
2004-01-26 19:19 ` Randy Brukardt
2004-01-24 6:08 ` Robert I. Eachus
2004-01-23 13:11 ` Marin David Condic
2004-01-22 14:12 ` Dmitry A. Kazakov
[not found] ` <ldlq00hmnm7ofaqem3kkrt7qhf6o7kjfmj@4ax.com>
2004-01-21 12:20 ` why ada is so unpopular ? Marin David Condic
2004-01-19 13:09 ` Jeff C,
2004-01-19 23:03 ` Robert I. Eachus
2004-01-20 1:10 ` cl1
2004-01-20 5:34 ` Robert I. Eachus
2004-01-20 7:37 ` Preben Randhol
2004-01-20 16:41 ` Robert I. Eachus
2004-01-20 23:59 ` Stephen Leake
2004-01-21 10:29 ` Preben Randhol
2004-01-17 23:01 ` Marin David Condic
2004-01-18 0:30 ` Hyman Rosen
2004-01-18 2:06 ` cl1
2004-01-18 3:12 ` Hyman Rosen
2004-01-18 3:28 ` cl1
2004-01-18 14:34 ` Marin David Condic
2004-01-19 23:46 ` chris
2004-01-18 18:41 ` Jano
2004-01-21 2:01 ` Luke A. Guest
2004-01-21 14:23 ` Hyman Rosen
2004-01-21 14:31 ` Ludovic Brenta
2004-01-21 15:15 ` Hyman Rosen
2004-01-21 18:40 ` Robert A Duff
2004-01-21 18:31 ` chris
2004-01-22 13:11 ` Marin David Condic
2004-01-22 23:33 ` Stephen Leake
2004-01-23 13:25 ` Marin David Condic
-- strict thread matches above, loose matches on Subject: below --
2004-01-23 20:03 Standard Ada Preprocessor (Was: why ada is so unpopular ?) Leon Winslow
2004-01-24 2:00 ` Marin David Condic
2004-01-26 20:03 Lionel.DRAGHI
2004-01-26 23:10 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox