From: "Peter C. Chapin" <pcc482719@gmail.com>
Subject: Re: Ada as a first language
Date: 23 Mar 2009 11:03:37 GMT
Date: 2009-03-23T11:03:37+00:00 [thread overview]
Message-ID: <Xns9BD747BEB2151pcc482719gmailcom@198.186.192.137> (raw)
In-Reply-To: hhics4h0pagtf9gcc6n9bsdfh0i64atb65@4ax.com
Brian Drummond <brian_drummond@btconnect.com> wrote in
news:hhics4h0pagtf9gcc6n9bsdfh0i64atb65@4ax.com:
> However it is something of a minority language; you will be limited in
> the support and tools you can find for it.
The AdaMagic compiler by SofCheck:
http://www.sofcheck.com/products/adamagic.html
has a version that takes Ada95 source and generates C. I'm working with
a student who is using this product to write Ada for a small embedded
system for which we only have a C compiler. The bulk of the program is
written in Ada, translated to C using AdaMagic, and then compiled with
the "native" C compiler. The student has had to write a few low level
interfacing functions in C but calling them from Ada is simple
(especially given that the Ada compiler uses C as its output language
anyway).
In our project we are doing without the Ada runtime. We've even disabled
languaged mandated exceptions by providing trivial stub functions (in C)
to replace the ones usually used by AdaMagic. We are also using SPARK
which helps us to justify this radical step. For example a program that
obeys SPARK rules can never raise PROGRAM_ERROR due to a problem in
elaboration order. Thus we can safely "stub out" the C function that
does this in AdaMagic's runtime.
Anyway, this approach is actually working fairly well for us. It lets us
use Ada in a significant way on a very small system without an Ada
compiler. However, I'm not sure how generally applicable it is. For one
thing without SPARK one would want to make more use of the AdaMagic
runtime. SofCheck provides the source code for it, so porting the
runtime to your environment (basically compiling it with AdaMagic and
then compiling the generated C with the native C compiler) should be
possible. I don't know how difficult it is to do because we haven't
tried it.
I should also note that fluency in both Ada and C is desirable if one
tries this approach. So while interesting, it probably isn't of
immediate use to the OP.
Peter
next prev parent reply other threads:[~2009-03-23 11:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-22 2:26 Ada as a first language Chris
2009-03-22 10:36 ` mockturtle
2009-03-22 14:44 ` Brian Drummond
2009-03-23 11:03 ` Peter C. Chapin [this message]
2009-03-23 13:29 ` Brian Drummond
2009-03-25 10:51 ` Peter C. Chapin
2009-03-23 16:59 ` rolf.ebert_nospam_
2009-03-24 19:22 ` Tim Rowe
2009-04-04 1:42 ` Brian Gaffney
2009-04-07 9:50 ` Alex R. Mosteo
2009-03-22 15:21 ` Gary Scott
2009-03-23 8:28 ` Brian
2009-03-23 9:05 ` Jacob Sparre Andersen
2009-03-23 22:02 ` Brian
2009-03-24 1:41 ` Gautier
2009-03-24 5:56 ` Jacob Sparre Andersen
2009-03-24 22:30 ` Brian
2009-03-25 9:41 ` rmoldskr+usenet
2009-03-25 22:27 ` Brian
2009-03-25 17:58 ` John McCormick
2009-03-25 23:20 ` Brian
2009-03-23 12:08 ` Chris
2009-03-25 21:10 ` John McCormick
2009-04-11 16:40 ` Mike Silva
2009-03-23 23:05 ` jpwoodruff
2009-03-25 0:16 ` Martin
2009-03-25 15:54 ` John McCormick
-- strict thread matches above, loose matches on Subject: below --
1997-07-03 0:00 Ada as a First Language RC
1997-07-03 0:00 ` Michael Feldman
1997-07-06 0:00 ` Alan Brain
1997-07-06 0:00 ` Robert Dewar
1997-07-16 0:00 ` Eric James DeArment
1997-07-07 0:00 ` Shmuel (Seymour J.) Metz
1992-12-29 15:40 agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!vx9000.weber.edu!
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox