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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c5f189513e1f5f8a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!textspool1.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada as a first language From: "Peter C. Chapin" References: <01d59695$0$20632$c3e8da3@news.astraweb.com> Message-ID: User-Agent: Xnews/5.04.25 Date: 23 Mar 2009 11:03:37 GMT Organization: SoVerNet (sover.net) NNTP-Posting-Host: 9d4abef2.news.sover.net X-Trace: DXC=iL\MCEV;U]EP7I;=`^Ef6@K6_LM2JZB_C[6Fi;gm635H3?@`i3kGa5K[1K\@7STNkI_@^NCR@QTCO X-Complaints-To: abuse@sover.net Xref: g2news2.google.com comp.lang.ada:5202 Date: 2009-03-23T11:03:37+00:00 List-Id: Brian Drummond 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