comp.lang.ada
 help / color / mirror / Atom feed
From: gwinn@ma.ultranet.com (Joe Gwinn)
Subject: Re: Urgent question: malloc and ada...READ/NEW/FOLLOWUP
Date: 1998/04/16
Date: 1998-04-16T00:00:00+00:00	[thread overview]
Message-ID: <gwinn-1604980010220001@d9.dial-4.cmb.ma.ultra.net> (raw)
In-Reply-To: dewar.892603771@merv


In article <dewar.892603771@merv>, dewar@merv.cs.nyu.edu (Robert Dewar) wrote:

> Joe said
> 
> <<Ada95 should allow one to do without such hacks, but it still isn't
> totally smooth, but the multiple-language problem isn't restricted to Ada,
> and never was.
> >>
> 
> Please give us some details as to what is not smooth. I find it hard to
> find any specific information in your message. What Ada 95 compiler have
> you used? What specific difficulties have you had in interfacing to other
> languages (in particular to C, Fortran or COBOL using the defined features
> in Ada 95).

It's a lot of little things, too many to really list in any detail. 
Alignment and padding of and between various size fields is a big issue,
especially if the processor hardware in the various participating machines
have different data alignment requirements.  All the gritty details needed
to ensure that data structures defined in two unrelated languages and
compilers are absolutely congruent, to the bit, always and forever.  I
have never seen any real pattern implicating any one language or compiler,
although one's chances are better if all involved compilers came from one
source, and simpler languages tend to cause less trouble.  No high-order
language really allows one to fully control the representation of complex
data structures in memory, although some give it more lip service than
others.  Assembly code will never die; it may be ugly, but it always
works, and it's unlikely to try to outsmart you.

If you are trying to verify or improve GNAT's interface to C and/or UDP
messages from other machines of different manufacture via communications,
I would try to implement something that handles complex UDP messages sent
between these three worlds, and see how it goes.  I bet you will find lots
to fix; we always do, but are forced to evade rather than really fix
things, not having command of the Ada compiler.  Then, when it all seems
to work, add a field to the beginning of a message format, upgrade a
compiler or two, and change a machine type or two.  

One thing that has improved noticably over the last decade is that
hardware floating point formats are now pretty much standardized under
IEEE Std 754.  In the old days, you only rarely could afford to have
floating point variables in messages sent between different kinds of
machine as no two floating point formats were the same.  Now, if the
machines are of the same endian persuasion, 32-bit and 64-bit floats in
messages work just fine.  The other IEEE float formats aren't universally
supported.

Joe Gwinn




  reply	other threads:[~1998-04-16  0:00 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-07  0:00 Urgent question: malloc and ada Guido Tesch
1998-04-09  0:00 ` Joe Gwinn
1998-04-10  0:00   ` Urgent question: malloc and ada...READ/NEW/FOLLOWUP Larry Kilgallen
1998-04-12  0:00     ` Joe Gwinn
1998-04-14  0:00       ` Robert Dewar
1998-04-16  0:00         ` Joe Gwinn [this message]
1998-04-17  0:00           ` Robert Dewar
1998-04-18  0:00             ` Joe Gwinn
1998-04-18  0:00               ` Robert Dewar
1998-04-25  0:00                 ` Joe Gwinn
1998-04-26  0:00                   ` Robert Dewar
1998-04-26  0:00                     ` Jonathan Guthrie
1998-04-26  0:00                       ` Simon Wright
1998-04-26  0:00                         ` Larry Kilgallen
1998-04-27  0:00                           ` Stephen Leake
1998-04-26  0:00                       ` Robert Dewar
1998-04-30  0:00                       ` Robert I. Eachus
1998-04-30  0:00                         ` Urgent question: malloc and ada Larry Kilgallen
1998-05-01  0:00                           ` Robert Dewar
1998-05-01  0:00                             ` Charles Hixson
1998-05-02  0:00                               ` Jonathan Guthrie
1998-05-02  0:00                             ` Corey Minyard
1998-05-06  0:00                             ` Robert I. Eachus
1998-05-12  0:00                               ` Craig T. Spannring
1998-05-12  0:00                                 ` Robert Dewar
     [not found]                           ` <matthew_heaney-ya023680003004981723000001@news.ni.net>
1998-05-01  0:00                             ` Robert Dewar
1998-05-01  0:00                               ` Larry Kilgallen
1998-05-02  0:00                                 ` Robert Dewar
1998-05-02  0:00                                   ` Jonathan Guthrie
1998-05-03  0:00                                     ` Robert Dewar
1998-05-03  0:00                                     ` Richard Kenner
1998-05-03  0:00                                       ` Jonathan Guthrie
1998-05-03  0:00                                         ` Robert Dewar
1998-05-03  0:00                                         ` Richard Kenner
1998-05-03  0:00                                   ` Larry Kilgallen
1998-05-01  0:00                       ` Urgent question: malloc and ada...READ/NEW/FOLLOWUP Fergus Henderson
1998-05-01  0:00                     ` Joe Gwinn
1998-05-02  0:00                       ` Larry Kilgallen
1998-05-05  0:00                       ` Robert Dewar
1998-04-10  0:00   ` Urgent question: malloc and ada Robert Dewar
1998-04-12  0:00     ` Joe Gwinn
1998-04-12  0:00       ` Enumeration Types (was: Urgent question: malloc and ada) Matthew Heaney
1998-04-13  0:00         ` Mark A Biggar
replies disabled

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