comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Using Ada (or SPARK) in Ada-unaware environment
Date: Thu, 19 Jan 2006 07:00:02 -0800
Date: 2006-01-19T07:00:02-08:00	[thread overview]
Message-ID: <HoydnbihfPkmNVLenZ2dnUVZ_v6dnZ2d@comcast.com> (raw)
In-Reply-To: dqnkoj$pb4$1@sunnews.cern.ch

"Maciej Sobczak" <no.spam@no.spam.com> wrote in message 
news:dqnkoj$pb4$1@sunnews.cern.ch...
> Hi,
>
> Imagine a control system (to be developed) which needs to interact with 
> some devices. Those devices are supplied with C drivers and libraries.
>
> What is the recommended practice for developing this control system in Ada 
> (or SPARK)? I basically see two options for this:
>
> 1. Enjoy Ada's ability to interface with C libraries (pragma Import) and 
> write everything in Ada.
>
> 2. Write separate programs in C (or C++) that will be responsible only for 
> talking to the devices via their C access libraries. Write the main 
> controller in Ada, as another separate program, and use some form of 
> interprocess communication to have all those components talk.
>
> The advantage of the second option is that the controller part can be 
> easily tested in isolation or in a fake environment.

Please explain why it is easier to test the the control part in isolation or 
in a
fake environment in C than in Ada.
This is not obvious to me.
In my experience, I have found just the opposite to be true.  I have found 
that
it is easier (in the long run) to do as much code as possible in Ada.

BTW: Tools are available to assist in creating Ada interfaces to C 
libraries.

Steve
(The Duck)

> Are there some other options for this? What is the industry recommented 
> practice?
>
> Regards,
>
> -- 
> Maciej Sobczak : http://www.msobczak.com/
> Programming    : http://www.msobczak.com/prog/ 





  parent reply	other threads:[~2006-01-19 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19  9:05 Using Ada (or SPARK) in Ada-unaware environment Maciej Sobczak
2006-01-19 10:16 ` Niklas Holsti
2006-01-19 10:21 ` Peter Amey
2006-01-19 20:05   ` Jeffrey R. Carter
2006-01-20  5:08   ` tmoran
2006-01-19 15:00 ` Steve [this message]
2006-01-19 15:45   ` Maciej Sobczak
2006-01-19 20:26     ` Simon Wright
2006-01-20  0:50 ` John
replies disabled

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