From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b75d36fda92b3ba X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 19 Jan 2006 08:56:59 -0600 From: "Steve" Newsgroups: comp.lang.ada References: Subject: Re: Using Ada (or SPARK) in Ada-unaware environment Date: Thu, 19 Jan 2006 07:00:02 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response Message-ID: NNTP-Posting-Host: 24.20.111.245 X-Trace: sv3-FkxIPGisnQNgQbmbnztTDn/ApZG+XaBzPt8ZOD1RS42jZOAxOHwnM5THvEXd+UIVz3rb5yRneJK7Frq!to6imack8AwG1IBpH8S22S+/lTHK6xYLhYN7gC3vVDnNLnSd1jZqFmLvX+p3vHyzhrvMTpsRkqlv!Vvxd1jhL9VhimQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:2534 Date: 2006-01-19T07:00:02-08:00 List-Id: "Maciej Sobczak" 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/