comp.lang.ada
 help / color / mirror / Atom feed
From: jpwoodruff@irisinternet.net (John Woodruff)
Subject: Re: socket, pipe
Date: 4 Nov 2003 10:48:25 -0800
Date: 2003-11-04T10:48:25-08:00	[thread overview]
Message-ID: <34defe4d.0311041048.252b191@posting.google.com> (raw)
In-Reply-To: 56a4b188.0311040645.64f825f7@posting.google.com

eieio@coastalnet.com (ghostie) wrote in message news:<56a4b188.0311040645.64f825f7@posting.google.com>...
> I'm quite the Ada newbie.  I'm really a C++ programmer.  But I've been
> tasked with making a change to an Ada application that we have, and
> would appreciate some help getting started.  Please be patient.
> 
> We want our Ada application, while running, to share a lot of binary
> information with a different application, this one written in Matlab. 
> Each applicaton will produce output data which will be used by the
> other application. Both applications will run on Win2K PCs, and they
> may or may not be on the same computer.


The issue I would decide first is whether data transport through a
file is adequate.  If yes, life will be much easier, since each
application stands alone and the intermediate file can be examined
carefully to assure that the interface is met.  However, this will be
somewhat slower, so might not meet performance req's.

If file transport is OK, then Ada IO using sequential_io should be
fairly straightforward.

However if the communication is bi-directional, or "real" time linkage
is required, then you will have to communicate between the processes. 
What is the interface that the Matlab app defines?  The incoming data
structure defined by the Matlab program can be described in Ada using
"representation clauses" to assure that the parameters sent by Ada to
Matlab conform to the spec.

One more prospect:  could the Matlab app be encapsulated into a
CORBA-compliant program?  If so, then you could define the interface
in CORBA IDL, and let the IDL-generated interface *in each language*
solve the issue of parameter types.

In my opinion, using the direct connection through pipes (for example)
is the most demanding because of the difficulty of matching the
calling conventions of the two language compilers *exactly*.  (Failing
to match exactly will cause obscure crashes in the invoked program; 
the practical fix for this is long hours at the debugger and
painstaking care with representation clauses.)

Best
John



  parent reply	other threads:[~2003-11-04 18:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04 14:45 socket, pipe ghostie
2003-11-04 15:14 ` Ole-Hjalmar Kristensen
2003-11-04 15:33 ` Marius Amado Alves
2003-11-04 17:45   ` Warren W. Gay VE3WWG
2003-11-04 18:48 ` John Woodruff [this message]
2003-11-05  3:27 ` Steve
2003-11-05  5:24   ` tmoran
2003-11-05  9:44 ` Pascal Obry
2003-11-05 12:31 ` Marin David Condic
2003-11-05 14:50   ` Steve
2003-11-05 15:19   ` Steve
2003-11-05 13:45 ` ghostie
2003-11-05 18:54   ` ghostie
2003-11-05 20:41     ` Robert Spooner
2003-11-05 20:18   ` Martin Dowie
2003-11-05 20:23     ` Martin Dowie
2003-11-05 13:54 ` ghostie
2003-11-05 14:26   ` Marius Amado Alves
2003-11-05 23:55   ` Jacob Sparre Andersen
  -- strict thread matches above, loose matches on Subject: below --
2003-11-05 18:49 Beard, Frank Randolph CIV
2003-11-05 19:43 Beard, Frank Randolph CIV
2003-11-05 21:14 ` tmoran
replies disabled

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