comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
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
Date: 2003-11-18T22:14:20+00:00	[thread overview]
Message-ID: <ubrr91g7a.fsf@nasa.gov> (raw)
In-Reply-To: vrkvm963glk1d4@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Stephen Leake" <Stephe.Leake@nasa.gov> 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



  reply	other threads:[~2003-11-18 22:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-13 19:50 Is it possible to build an Ada cross-compiler for an 8-bit embedded target now that gcc 3.X has support for Ada? Peter Milliken
2003-11-13 21:02 ` Peter Milliken
2003-11-14  9:53 ` Peter Amey
2003-11-14 18:59   ` Mike Silva
2003-11-14 19:52     ` Martin Dowie
2003-11-17 21:57 ` Randy Brukardt
2003-11-18 16:03   ` Stephen Leake
2003-11-18 20:17     ` Randy Brukardt
2003-11-18 22:10       ` Stephen Leake [this message]
2003-11-19 20:12         ` Randy Brukardt
2003-11-19 22:23           ` Chad R. Meiners
2003-11-18 19:55   ` Peter Milliken
2003-11-18 20:11     ` Randy Brukardt
replies disabled

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