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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd9a8f91bb89a8d2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-18 14:16:50 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Is it possible to build an Ada cross-compiler for an 8-bit embedded target now that gcc 3.X has support for Ada? Date: 18 Nov 2003 17:10:01 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: shevek.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1069193660 14919 128.183.235.101 (18 Nov 2003 22:14:20 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 18 Nov 2003 22:14:20 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:2655 Date: 2003-11-18T22:14:20+00:00 List-Id: "Randy Brukardt" writes: > "Stephen Leake" wrote in message > news:uptfp3bpu.fsf@nasa.gov... > > Note that the "no runtime" subset of Ada is still a _far_ better > > language than C. So it is worth persuing, since you already have the > > code-generation part in the gcc back end. The result won't be "Ada", > > but it will be a very useful subset. > > > > GNAT provides a "pragma No_Runtime", which reports errors for any code > > that would use the runtime, so you can tell when you need to change > > the code. > > I'm a bit suspicious of this claim, mainly because you'd have to run with > checks suppressed in order to avoid use of the runtime. I have code for a spacecraft that uses "pragma No_Runtime", and does _not_ include the GNAT runtime in the link (I don't have a GNAT runtime that compiles for this processor/OS combination :). "pragma No_Runtime" isn't in the standard GNAT manual, so I can't check whether it implies "suppress all checks"; it may. But that's ok; we run with checks suppressed for the final flight code anyway; we've already tested everything, and all checks that are needed are done explicitly, to make them visible to reviewers. > (Handling/reporting any failure, even to abort the program, would > require some sort of runtime. Just stopping the program with no > indication of why doesn't need any runtime, but its just as useful > as running with checks suppressed.) Right. > Runtime checking is a very important part of Ada, Only during the unit test phase. I run the unit tests on a different processor with checks on; that catches logic errors. It would be nice to repeat the tests on the target processor still with checks on, but that only catches compiler bugs or implementation-dependent code; runtime checks are not very helpful there. > (and one which doesn't add much overhead in general), and running > without it would seem to be writing C with Ada syntax. Even writing "C with Ada syntax" is _way_ better than writing "C with C syntax". That was my original point. You get namespace control with packages, named association in aggregates and function calls, nested procedures, generics; lots of really good stuff. > After all, it's basic exception handling that makes Ada programs so > bullet-proof. That's only one aspect. Compile time type checking, and the other features I mentioned above, are also important. I agree "no runtime Ada" is not as good as "full Ada". But it is very much better than C. > (The AdaIC webserver has yet to log any downtime related to the > program itself - all downtime has been hardware or OS failures.) Which is a consequence of good design. How many times has it caught an exception generated by a runtime check? I would class those as "bugs", even if they don't cause lots of downtime. -- -- Stephe