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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac55ec18f7b0a53c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-04 13:00:21 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!grolier!newsfeed.planete.net!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Ada and embedded applications Date: Mon, 4 Jun 2001 15:34:12 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9fgnrm$auh$1@nh.pace.co.uk> References: NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 991683254 11217 136.170.200.133 (4 Jun 2001 19:34:14 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 4 Jun 2001 19:34:14 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:8085 Date: 2001-06-04T19:34:14+00:00 List-Id: Ada in general allows compilers to be creative about how they handle the implementation of features to be as small and/or efficient as possible. For example, GNAT has a version that restricts some features of the language in order to be able to go to a "No Runtime" result. (Its called GNORT, in case you want to do some searching for info on it.) You lose some features, but can make code that doesn't depend on anything but what you provide. GNAT itself is available for the cost of a download if you don't need support. (Don't know for sure about GNORT.) So I don't think it ought to be a budgetary issue. Many embedded projects are using GCC as their compiler - GNAT isn't any different in how it can be used. As for exceptions - the space/speed is going to vary depending on the compiler. Again, there isn't anything in there that requires megabytes of memory or huge processing overhead, but all compilers are different. I think you'd find that whatever overhead is there that it isn't excessive - or even the biggest ticket item on the list of features. Think about it this way: Real-world embedded applications need to do a variety of failure detection & accommodation things. You have to do checks for math overflows, out of bounds references, out of memory conditions, etc. etc. Ada provides you with exceptions which require some non-zero overhead to deal with. C provides you with *nothing* and hence has no overhead. The problem is that because you still need to check for error conditions, you're going to have to do *something* on your own - thus creating more overhead. It makes C look great for a while ("Look! No overhead!") until you realize you've got all this extra code hanging around doing error processing of some form. Usually, compiler generated stuff is going to end up more efficient in the long run, especially for more mature compilers. Ada is really good for applications that have a high reliability requirement specifically because of all the checking it does (compile and run time) for error conditions. If you think Ada is expensive, get a price quote on failure! :-) With Ada, if you really need to, you can turn off the standard exceptions and if you don't create any of your own, you should impose no additional overhead on your program. C gives you no choice in the matter. You have to be *very careful* when listening to C programmers talk about Ada because usually they base their criticisms on a variety of rumors, FUD, misinformation, etc., or a BAD experience with one particular compiler developed 15 years ago. (Like getting a BAD meal in a restaurant - maybe it was just one bad day for an otherwise good restaurant, but it left a bad taste in your mouth and you never go back.) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Chris Campbell" wrote in message news:LTQS6.29382$%_1.5022327@news2-win.server.ntlworld.com... > Hi, > > On another group a discussion about various languages errupted and it took a > while to get anything positive out of it(it's started as the old "my language is > best" debate). Now the discussion seems to be focussed on distance from > hardware, like C being relatively close to hardware. This is largely irrelevant > background. > > One poster claimed that Ada was not used in some embedded devices because of > memory overheads for exception handling. Claiming it was used in embedded > devices in industries that had budgets that supported it (e.g. the aerospace > industry). > > > Is this correct or is it rubbish? Also does exception handling in Ada really > have a large overhead? (This is probably an implementation issue but is their > anything in the language that makes exception handling bulky?). > > I'm curious because one of the projects i'm working on involves writing an OS. > It's supposed to be as small as possible and i wouldn't want too many overheads. > (Also are exceptions dependant on platform? i.e. the mechanisms for flagging an > exception dependant on the OS? If so the GNAT pragma No_Runtime would eliminate > this, but i'd have no exceptions to tell me if my code's buggered). > > > > > Chris Campbell. > >