comp.lang.ada
 help / color / mirror / Atom feed
* Ada communicating with other programs
@ 2001-11-20 13:10 Siegfried Gonzi
  2001-11-20 14:39 ` M. A. Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Siegfried Gonzi @ 2001-11-20 13:10 UTC (permalink / raw)


Actually I am learning a little bit Ada 95, therefore a few questions:

a) Is it hard for Ada to communicate with other programs? I often have
to deal with big array computations. Currently, I am using Clean (a
functional language with a very matured compiler and as fast a C++) but
it is not possible (whether on Unix, Macintosh or Windows) to really
communicate with other programs. What I love on Clean is its strict-type
behaviour (therefore I would have no problems with the Ada type system).
But I always have to save my computations in a file and post-process it
with Matlab or Yorick,...

Are there any guys who are using Ada in companion with a visualization
tool? Concrete: Calculating an array and passing it immediately to a
visualization program for plotting.

aa) Is it hard in Ada to do "semi command line programming". In Clean I
do not have really a command-line (as with Matlab or IDL or Scilab;but I
cannot program in these languages because I cannot live without types).
Are there any guys who prefer Ada for this kind of tasks (normally
attributed to Matlab or IDL)?


b) How easy is it in Ada to read in a file of the following structure:

Day,Time,Val1,Val2
01:23:2001,12:23:34,2.3445,233.34
02:03:2001,13:45:00,2,344,222

In Clean, I wrote a program to read in the values (after extracting from
the string) and stored it in an array, and by the way the day and time
has been converted to fractional days of the year.

The Clean program consits of nearly 100 lines of code. I ask here "how
easy can it be in Ada", because I have been really depressed and asked
myself why I have to waste my time with such things and is there a
clearer way extracting the values.

c) Is there an aha experience when one is confronted in Ada with "not
having the goody called garbage-collection". In Clean I am accustomed to
garbage-collection and pointer-free programming.


d) Often visualization tools support calling foreign functions, but
often only  C or Fortran. But will it be possible to also call a
compiled Ada function from this tools (lets say Scilab) or must  the
vendor of these tools explicitely support Ada?


Siegfried Gonzi.





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

* Re: Ada communicating with other programs
  2001-11-20 13:10 Ada communicating with other programs Siegfried Gonzi
@ 2001-11-20 14:39 ` M. A. Alves
  2001-11-20 15:29   ` Siegfried Gonzi
  2001-11-20 15:47   ` Preben Randhol
  2001-11-20 16:24 ` Jacob Sparre Andersen
  2001-11-20 16:55 ` Larry Kilgallen
  2 siblings, 2 replies; 17+ messages in thread
From: M. A. Alves @ 2001-11-20 14:39 UTC (permalink / raw)
  To: comp.lang.ada

On Tue, 20 Nov 2001, Siegfried Gonzi wrote:
> Actually I am learning a little bit Ada 95, therefore a few questions:
>
> a) Is it hard for Ada to communicate with other programs?

No.

> I often have to deal with big array computations. Currently, I am
> using Clean

Give us a reference, please.

> . . .
>
> aa) Is it hard in Ada to do "semi command line programming".

What is that?

> . . .
>
> b) How easy is it in Ada to read in a file of the following structure:
>
> Day,Time,Val1,Val2
> 01:23:2001,12:23:34,2.3445,233.34
> 02:03:2001,13:45:00,2,344,222
>
> . . .
>
> The Clean program consits of nearly 100 lines of code. I ask here "how
> easy can it be in Ada", because I have been really depressed and asked
> myself why I have to waste my time with such things and is there a
> clearer way extracting the values.

It is very easy to do it in Ada, but do expect a big number of lines.  If
you want tersness use a "write-only" language like any of the C
derivatives outhere e.g. PERL---but then be prepare to waste some serious
time chasing bugs.

You you cleary state the specs for the program you're currently
implementing in 100-lines of Clean I can try to show you how to do it in
Ada as your first tutorial ;-)

> c) Is there an aha experience when one is confronted in Ada with "not
> having the goody called garbage-collection".

I haven't felt the need for that yet.  In Ada you can do everything
keeping the variables under a nice (dynamic as well as static) scope.
(And of course some guys will tell you how garbage collection slows things
down.)

> . . . pointer-free programming.

Ditto.

> d) Often visualization tools support calling foreign functions, but
> often only  C or Fortran. But will it be possible to also call a
> compiled Ada function from this tools (lets say Scilab) . . .

If your tool is (in) a C or Fortran library you should have no problem
linking it with Ada programs.  I do it all the time.  Chances are there is
already an Ada package binding the library.

Welcome to Ada ;-)

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150-180 PORTO, Portugal    mob 351+939354002





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

* Re: Ada communicating with other programs
  2001-11-20 14:39 ` M. A. Alves
@ 2001-11-20 15:29   ` Siegfried Gonzi
  2001-11-20 15:47   ` Preben Randhol
  1 sibling, 0 replies; 17+ messages in thread
From: Siegfried Gonzi @ 2001-11-20 15:29 UTC (permalink / raw)


"M. A. Alves" schrieb:

> > I often have to deal with big array computations. Currently, I am
> > using Clean
>
> Give us a reference, please.

Clean should not become the subject here. A google search will quickly
delegate you to their homepage:

http://www.cs.kun.nl/~clean/

> > aa) Is it hard in Ada to do "semi command line programming".
>
> What is that?

In Yorick (or Scilab or Matlab) you can do something like this:

a=span(0.0,Pi,100) //creating an array from 0.0 to Pi with 100 points
b=fft(a) //doing the FFT
plg,a //plotting the FFT

In Clean I do not have the command line (Matlab or Yorick are interpreters)
and I have to compile my program:

e.g. creating a 2 dimensional array filled up with values ranging from 0.0 to
N (for every row):

Clean program:
==
module makeArray
importStdEnv

makeArray:: !Int !Int  -> !{#{#Real}}
makeArray row column = { { j \\ j <- [0..(column-1)] } \\ i <- [0..(row-1)] }

Start = makeArray 3 3
==

I can use it only after compiling (compiling and linking is the same process
in Clean). The array is safe and under the protection of garbage-collection; I
could even not call it with inappropiate types,e.g.


Start = makeArray 3.0 3.0



> > The Clean program consits of nearly 100 lines of code. I ask here "how
> > easy can it be in Ada", because I have been really depressed and asked
> > myself why I have to waste my time with such things and is there a
> > clearer way extracting the values.
>
> It is very easy to do it in Ada, but do expect a big number of lines.  If
> you want tersness use a "write-only" language like any of the C
> derivatives outhere e.g. PERL---but then be prepare to waste some serious
> time chasing bugs.
>

Tersness is not my aim (Clean is also a language for re-using code). But I had
a hard time to implement it in Clean, because I had to implement some
primitives by myself (okay, with pattern-matching �t has been not too time
consuming). At the end of the post is a code snippet of the core-code which
reads in from a file.

>
> You you cleary state the specs for the program you're currently
> implementing in 100-lines of Clean I can try to show you how to do it in
> Ada as your first tutorial ;-)

The task was to read the following file into an array( the line numbers and
the number of array columns are not know; only the number of header lines are
know):

here is
a header
line and maybe
many more
Day,Time,Val1,Val2,...
01:23:2001,12:23:34,2.3445,233.34,...
02:03:2001,13:45:00,2,344,222.34,...
....
....


> > c) Is there an aha experience when one is confronted in Ada with "not
> > having the goody called garbage-collection".
>
> I haven't felt the need for that yet.  In Ada you can do everything
> keeping the variables under a nice (dynamic as well as static) scope.
> (And of course some guys will tell you how garbage collection slows things
> down.)

In worse cases Clean is only 2 times slower as a tuned (but not inlined) C
code. For example a 2 dimensional 1024x1024 FFT in Clean is about 1.5 to 2
times slower as the same C version. The garbage-collection in Clean is one of
the best I know (maybe some commercial Lisps are in that ligue).

> Welcome to Ada ;-)

Time will show...


S. Gonzi
Only for the curiosity
==
ADatumTimeStringRead:: !Char !Char {!*{!Real}} !File -> {!*{!Real}}
ADatumTimeStringRead char char_d marray file = fill_up 0 marray file
where
        fill_up:: !Int {!*{!Real}} !File -> {!*{!Real}}
        fill_up n marray file
                | n == (size marray) = marray
                #! (string, file) = sfreadline file
                #! elem =       (RealfromDatumTime_String char_d
(DStringtoString_List char string))
                #! elemo = {x\\x<- elem}
                = fill_up (n+1) { marray & [n] = elemo } file

RealfromDatum_String:: !Char ![!String] -> ![!Real]
RealfromDatum_String char [] = []
RealfromDatum_String char [x,y:r] = [ Datum_StringtoReal char x ,
Time_StringtoReal char y : RealfromString r ]

RealfromDatumTime_String:: !Char ![!String] -> ![!Real]
RealfromDatumTime_String char [] = []
RealfromDatumTime_String char [x,y:r] = [ (Datum_StringtoReal char x) +
(Time_StringtoReal char y) : RealfromString r ]

Time_StringtoReal:: !Char !String -> !Real
Time_StringtoReal char string = (toReal(hour) + ((toReal(minute))/60.0) +
((toReal(second))/3600.0) ) / 24.0
where
        string_list = StringtoString_List char string
        hour = string_list !! 0
        minute = string_list !! 1
        second = string_list !! 2

Datum_StringtoReal:: !Char !String -> !Real
Datum_StringtoReal char string = toReal (day) + toReal ( months !! (toInt
month) )
where
        string_list = StringtoString_List char string
        day = string_list !! 0
        month = string_list !! 1
        year = toInt (string_list !! 2)
        //year:: !Int
        //year
        //      |  toInt (string_list !! 2) >= 0 = toInt (string_list !! 2) +
2000
        //      = toInt (string_list !! 2) + 1900
        //
        months:: [!Real]
        months
                | ( leap year ) =
[0.0,0.0,31.0,60.0,91.0,121.0,152.0,182.0,213.0,244.0,274.0,305.0,335.0]
                =
[0.0,0.0,31.0,59.0,90.0,120.0,151.0,181.0,212.0,243.0,273.0,304.0,334.0]
        //
        leap :: !Int -> Bool
        leap y
                | divisible y 100 = divisible y 400
                = divisible y 4
        //
        divisible :: !Int !Int -> Bool
        divisible t n = t rem n == 0
==
AND SO ON





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

* Re: Ada communicating with other programs
  2001-11-20 14:39 ` M. A. Alves
  2001-11-20 15:29   ` Siegfried Gonzi
@ 2001-11-20 15:47   ` Preben Randhol
  2001-11-20 16:35     ` M. A. Alves
                       ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Preben Randhol @ 2001-11-20 15:47 UTC (permalink / raw)


On Tue, 20 Nov 2001 14:39:51 +0000 (GMT), M. A. Alves wrote:
> 
> It is very easy to do it in Ada, but do expect a big number of lines.  If
> you want tersness use a "write-only" language like any of the C
> derivatives outhere e.g. PERL---but then be prepare to waste some serious
> time chasing bugs.

Why not use the regex capabilities of GNAT?

Preben
-- 
 ()   Join the worldwide campaign to protect fundamental human rights.
'||}
{||'                                           http://www.amnesty.org/



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

* Re: Ada communicating with other programs
  2001-11-20 13:10 Ada communicating with other programs Siegfried Gonzi
  2001-11-20 14:39 ` M. A. Alves
@ 2001-11-20 16:24 ` Jacob Sparre Andersen
  2001-11-20 16:55 ` Larry Kilgallen
  2 siblings, 0 replies; 17+ messages in thread
From: Jacob Sparre Andersen @ 2001-11-20 16:24 UTC (permalink / raw)


Siegfried Gonzi wrote:

> aa) Is it hard in Ada to do "semi command line programming".

Ada is certainly not usable at a command line interface, but
there exists an (experimental?) Ada-like command line
interpreter. I think it's called "bush".

> b) How easy is it in Ada to read in a file of the following structure:
> 
> Day,Time,Val1,Val2
> 01:23:2001,12:23:34,2.3445,233.34
> 02:03:2001,13:45:00,2,344,222
> 
> In Clean, I wrote a program to read in the values (after extracting from
> the string) and stored it in an array, and by the way the day and time
> has been converted to fractional days of the year.
> 
> The Clean program consits of nearly 100 lines of code. I ask here "how
> easy can it be in Ada", because I have been really depressed and asked
> myself why I have to waste my time with such things and is there a
> clearer way extracting the values.

Reasonably easy. Ada comes with a calendar package and with
functions for converting strings to built-in types. I expect
the program would take up 10 to 30 lines.

> c) Is there an aha experience when one is confronted in Ada with "not
> having the goody called garbage-collection". In Clean I am accustomed to
> garbage-collection and pointer-free programming.

You don't have to use access types (pointers) in Ada. I
haven't noticed any serious problems with not having
garbage-collection in most of my Ada run-time systems.

> d) Often visualization tools support calling foreign functions, but
> often only  C or Fortran. But will it be possible to also call a
> compiled Ada function from this tools (lets say Scilab) or must  the
> vendor of these tools explicitely support Ada?

Most (all?) Ada compilers support interfacing to other
languages. This allows you to export (and import) objects
and routines as if they were written in C, Cobol or Fortran.
So C or Fortran support should be good enough.

Jacob
-- 
"Kan det virkelig passe at liberale v�lgere skal stemme SF
 for at f� friheden til at v�lge hvilke softwareprodukter
 de bruger?"                               -- Peter Mogensen

"Kristeligt Folkeparti er nu ogs� en mulighed."     -- Jacob

"[men] de er binderavende sindssyge, og da de efter al
 sandsynlighed vil medvirke til at Dansk Folkeparti f�r
 noget at skulle have sagt, kan jeg under ingen
 omst�ndigheder udholde tanken"          -- Kristian Vilmann



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

* Re: Ada communicating with other programs
  2001-11-20 15:47   ` Preben Randhol
@ 2001-11-20 16:35     ` M. A. Alves
  2001-11-20 16:44       ` Preben Randhol
  2001-11-20 16:51     ` Larry Kilgallen
  2001-11-20 23:14     ` tmoran
  2 siblings, 1 reply; 17+ messages in thread
From: M. A. Alves @ 2001-11-20 16:35 UTC (permalink / raw)
  To: comp.lang.ada

On Tue, 20 Nov 2001, Preben Randhol wrote:
> On Tue, 20 Nov 2001 14:39:51 +0000 (GMT), M. A. Alves wrote:
> >
> > It is very easy to do it in Ada, but do expect a big number of lines.  If
> > you want tersness use a "write-only" language like any of the C
> > derivatives outhere e.g. PERL---but then be prepare to waste some serious
> > time chasing bugs.
>
> Why not use the regex capabilities of GNAT?

Yes that would indeed be more _terse_ than using GNAT.Spitbol.Patterns ;-)

-- 
   ,
 M A R I O   data miner, LIACC, room 221   tel 351+226078830, ext 121
 A M A D O   Rua Campo Alegre, 823         fax 351+226003654
 A L V E S   P-4150-180 PORTO, Portugal    mob 351+939354002





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

* Re: Ada communicating with other programs
  2001-11-20 16:35     ` M. A. Alves
@ 2001-11-20 16:44       ` Preben Randhol
  0 siblings, 0 replies; 17+ messages in thread
From: Preben Randhol @ 2001-11-20 16:44 UTC (permalink / raw)


On Tue, 20 Nov 2001 16:35:50 +0000 (GMT), M. A. Alves wrote:
> On Tue, 20 Nov 2001, Preben Randhol wrote:
>> On Tue, 20 Nov 2001 14:39:51 +0000 (GMT), M. A. Alves wrote:
>> >
>> > It is very easy to do it in Ada, but do expect a big number of lines.  If
[...]
>>
>> Why not use the regex capabilities of GNAT?
> 
> Yes that would indeed be more _terse_ than using GNAT.Spitbol.Patterns ;-)

I was thinking about the big number of lines you said above. :-)

Preben
-- 
 ()   Join the worldwide campaign to protect fundamental human rights.
'||}
{||'                                           http://www.amnesty.org/



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

* Re: Ada communicating with other programs
  2001-11-20 15:47   ` Preben Randhol
  2001-11-20 16:35     ` M. A. Alves
@ 2001-11-20 16:51     ` Larry Kilgallen
  2001-11-20 19:27       ` Pascal Obry
  2001-11-20 19:48       ` Preben Randhol
  2001-11-20 23:14     ` tmoran
  2 siblings, 2 replies; 17+ messages in thread
From: Larry Kilgallen @ 2001-11-20 16:51 UTC (permalink / raw)


In article <slrn9vkukr.6f6.randhol+abuse@kiuk0156.chembio.ntnu.no>, Preben Randhol <randhol+abuse@pvv.org> writes:
> On Tue, 20 Nov 2001 14:39:51 +0000 (GMT), M. A. Alves wrote:
>> 
>> It is very easy to do it in Ada, but do expect a big number of lines.  If
>> you want tersness use a "write-only" language like any of the C
>> derivatives outhere e.g. PERL---but then be prepare to waste some serious
>> time chasing bugs.
> 
> Why not use the regex capabilities of GNAT?

Perhaps because he said he wanted to do it in Ada.



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

* Re: Ada communicating with other programs
  2001-11-20 13:10 Ada communicating with other programs Siegfried Gonzi
  2001-11-20 14:39 ` M. A. Alves
  2001-11-20 16:24 ` Jacob Sparre Andersen
@ 2001-11-20 16:55 ` Larry Kilgallen
  2001-11-20 19:52   ` Mark Lundquist
  2 siblings, 1 reply; 17+ messages in thread
From: Larry Kilgallen @ 2001-11-20 16:55 UTC (permalink / raw)


In article <3BFA5654.519D8BC8@kfunigraz.ac.at>, Siegfried Gonzi <siegfried.gonzi@kfunigraz.ac.at> writes:
> Actually I am learning a little bit Ada 95, therefore a few questions:
> 
> a) Is it hard for Ada to communicate with other programs?

Ada has an optional appendix to cover distributed programming
between multiple processes running in Ada, but anything more
general (to communicate with programs in other languages)
requires direct use of operating system features.  Thus it
may require work to port it to other operating systems.

Using operating system features in Ada is typically straightforward
because compiler vendors understand that is an important capability.
For those operating systems whose interface is C-centric, the Ada
interface will typically follow the appendix about interfacing to C.



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

* Re: Ada communicating with other programs
  2001-11-20 16:51     ` Larry Kilgallen
@ 2001-11-20 19:27       ` Pascal Obry
  2001-11-20 19:48       ` Preben Randhol
  1 sibling, 0 replies; 17+ messages in thread
From: Pascal Obry @ 2001-11-20 19:27 UTC (permalink / raw)



Kilgallen@SpamCop.net (Larry Kilgallen) writes:

> > Why not use the regex capabilities of GNAT?
> 
> Perhaps because he said he wanted to do it in Ada.

:)

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



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

* Re: Ada communicating with other programs
  2001-11-20 16:51     ` Larry Kilgallen
  2001-11-20 19:27       ` Pascal Obry
@ 2001-11-20 19:48       ` Preben Randhol
  2001-11-20 20:29         ` Ted Dennison
  1 sibling, 1 reply; 17+ messages in thread
From: Preben Randhol @ 2001-11-20 19:48 UTC (permalink / raw)


On 20 Nov 2001 10:51:00 -0600, Larry Kilgallen wrote:
>> Why not use the regex capabilities of GNAT?
> 
> Perhaps because he said he wanted to do it in Ada.

*sigh*

It isn't written in Ada now?

The file g-regexp.ads starts with this code (after snipping away the comments)

with Ada.Finalization;

package GNAT.Regexp is

And also very interestingly, these source files files are under the GNAT
modified GPL license, so you can simply take them and compile them with
your Ada compiler of choice and then use them. Instead of wasting several
days reinventing the wheel.

Would you have said the same if the regex had been a different library?

Preben
-- 
 ()   Join the worldwide campaign to protect fundamental human rights.
'||}
{||'                                           http://www.amnesty.org/



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

* Re: Ada communicating with other programs
  2001-11-20 16:55 ` Larry Kilgallen
@ 2001-11-20 19:52   ` Mark Lundquist
  2001-11-20 19:59     ` Preben Randhol
  2001-11-21  2:20     ` Larry Kilgallen
  0 siblings, 2 replies; 17+ messages in thread
From: Mark Lundquist @ 2001-11-20 19:52 UTC (permalink / raw)



"Larry Kilgallen" <Kilgallen@SpamCop.net> wrote in message
news:HAgg6Fearv8I@eisner.encompasserve.org...
> In article <3BFA5654.519D8BC8@kfunigraz.ac.at>, Siegfried Gonzi
<siegfried.gonzi@kfunigraz.ac.at> writes:
> > Actually I am learning a little bit Ada 95, therefore a few questions:
> >
> > a) Is it hard for Ada to communicate with other programs?
>
> Ada has an optional appendix to cover distributed programming
> between multiple processes running in Ada, but anything more
> general (to communicate with programs in other languages)
> requires direct use of operating system features.

Well...

1) Just to clarify, Ada has very good capabilities for interfacing with
*object code* written in other languages, and this of course has nothing to
do with direct use of OS features as long as we are talking about statically
linked executables (and even with shared libraries on Unix, interoperability
typically does not involve OS features at the source code level unless you
have special needs -- in which case you would have to jump through the same
hoops no matter what language you are programming in).

2) See David Botton's GNATCOM package for COM support for Ada on Wind*ws
(www.adapower.com/gnatcom).

3) CORBA implementations are available that work with Ada:
        www.ois.com
        www.topgraphx.com

-- mark






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

* Re: Ada communicating with other programs
  2001-11-20 19:52   ` Mark Lundquist
@ 2001-11-20 19:59     ` Preben Randhol
  2001-11-21  2:20     ` Larry Kilgallen
  1 sibling, 0 replies; 17+ messages in thread
From: Preben Randhol @ 2001-11-20 19:59 UTC (permalink / raw)


On Tue, 20 Nov 2001 19:52:37 GMT, Mark Lundquist wrote:
> 
> 3) CORBA implementations are available that work with Ada:
>         www.ois.com
>         www.topgraphx.com

See also: http://www.adapower.com/corba/

Preben
-- 
 ()   Join the worldwide campaign to protect fundamental human rights.
'||}
{||'                                           http://www.amnesty.org/



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

* Re: Ada communicating with other programs
  2001-11-20 19:48       ` Preben Randhol
@ 2001-11-20 20:29         ` Ted Dennison
  0 siblings, 0 replies; 17+ messages in thread
From: Ted Dennison @ 2001-11-20 20:29 UTC (permalink / raw)


In article <slrn9vlcof.f6.randhol+abuse@kiuk0156.chembio.ntnu.no>, Preben
Randhol says...
>
>On 20 Nov 2001 10:51:00 -0600, Larry Kilgallen wrote:
>>> Why not use the regex capabilities of GNAT?
>> 
>> Perhaps because he said he wanted to do it in Ada.
>It isn't written in Ada now?

My understanding was that it uses some assumptions about the internal structure
of Ada.Strings.Unbounded.Unbounded_String that may or may not be true for other
compilers, and for that reason it isn't portable. Its perhaps a bit of a stretch
to go from that to "isn't written in Ada", but it was pretty clearly at least a
half-joking comment.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html

No trees were killed in the sending of this message. 
However a large number of electrons were terribly inconvenienced.



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

* Re: Ada communicating with other programs
  2001-11-20 15:47   ` Preben Randhol
  2001-11-20 16:35     ` M. A. Alves
  2001-11-20 16:51     ` Larry Kilgallen
@ 2001-11-20 23:14     ` tmoran
  2001-11-21  9:03       ` Preben Randhol
  2 siblings, 1 reply; 17+ messages in thread
From: tmoran @ 2001-11-20 23:14 UTC (permalink / raw)


> > It is very easy to do it in Ada, but do expect a big number of lines.  If
> Why not use the regex capabilities of GNAT?
  The original post indicated the data was of the form:
Day,Time,Val1,Val2
01:23:2001,12:23:34,2.3445,233.34
so Day and Time appear to be fixed fields and the other values could be
gotten using Text_IO.Get, with Last pointing just before the comma at
the end of a number.  It really shouldn't require very many lines of
code, let alone PERL or regex, to parse that!



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

* Re: Ada communicating with other programs
  2001-11-20 19:52   ` Mark Lundquist
  2001-11-20 19:59     ` Preben Randhol
@ 2001-11-21  2:20     ` Larry Kilgallen
  1 sibling, 0 replies; 17+ messages in thread
From: Larry Kilgallen @ 2001-11-21  2:20 UTC (permalink / raw)


In article <9wyK7.51423$XJ4.30208867@news1.sttln1.wa.home.com>, "Mark Lundquist" <up.yerz@nospam.com> writes:
> 
> "Larry Kilgallen" <Kilgallen@SpamCop.net> wrote in message
> news:HAgg6Fearv8I@eisner.encompasserve.org...
>> In article <3BFA5654.519D8BC8@kfunigraz.ac.at>, Siegfried Gonzi
> <siegfried.gonzi@kfunigraz.ac.at> writes:
>> > Actually I am learning a little bit Ada 95, therefore a few questions:
>> >
>> > a) Is it hard for Ada to communicate with other programs?
>>
>> Ada has an optional appendix to cover distributed programming
>> between multiple processes running in Ada, but anything more
>> general (to communicate with programs in other languages)
>> requires direct use of operating system features.
> 
> Well...
> 
> 1) Just to clarify, Ada has very good capabilities for interfacing with
> *object code* written in other languages, and this of course has nothing to
> do with direct use of OS features as long as we are talking about statically
> linked executables (and even with shared libraries on Unix, interoperability
> typically does not involve OS features at the source code level unless you
> have special needs -- in which case you would have to jump through the same
> hoops no matter what language you are programming in).

When someone talks about communicating with "other programs",
I take it to mean executable images.  Otherwise they would have
asked about using "libraries".



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

* Re: Ada communicating with other programs
  2001-11-20 23:14     ` tmoran
@ 2001-11-21  9:03       ` Preben Randhol
  0 siblings, 0 replies; 17+ messages in thread
From: Preben Randhol @ 2001-11-21  9:03 UTC (permalink / raw)


On Tue, 20 Nov 2001 23:14:07 GMT, tmoran@acm.org wrote:
>> > It is very easy to do it in Ada, but do expect a big number of lines.  If
>> Why not use the regex capabilities of GNAT?
>   The original post indicated the data was of the form:
> Day,Time,Val1,Val2
> 01:23:2001,12:23:34,2.3445,233.34
> so Day and Time appear to be fixed fields and the other values could be
> gotten using Text_IO.Get, with Last pointing just before the comma at
> the end of a number.  It really shouldn't require very many lines of
> code, let alone PERL or regex, to parse that!

Yes if the format is fixed it should not be a problem.

Preben
-- 
 ()   Join the worldwide campaign to protect fundamental human rights.
'||}
{||'                                           http://www.amnesty.org/



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

end of thread, other threads:[~2001-11-21  9:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-20 13:10 Ada communicating with other programs Siegfried Gonzi
2001-11-20 14:39 ` M. A. Alves
2001-11-20 15:29   ` Siegfried Gonzi
2001-11-20 15:47   ` Preben Randhol
2001-11-20 16:35     ` M. A. Alves
2001-11-20 16:44       ` Preben Randhol
2001-11-20 16:51     ` Larry Kilgallen
2001-11-20 19:27       ` Pascal Obry
2001-11-20 19:48       ` Preben Randhol
2001-11-20 20:29         ` Ted Dennison
2001-11-20 23:14     ` tmoran
2001-11-21  9:03       ` Preben Randhol
2001-11-20 16:24 ` Jacob Sparre Andersen
2001-11-20 16:55 ` Larry Kilgallen
2001-11-20 19:52   ` Mark Lundquist
2001-11-20 19:59     ` Preben Randhol
2001-11-21  2:20     ` Larry Kilgallen

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