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,ac55ec18f7b0a53c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-04 14:16:32 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!newspeer.clara.net!news.clara.net!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail From: "Chris Campbell" Newsgroups: comp.lang.ada References: <9fgnrm$auh$1@nh.pace.co.uk> Subject: Re: Ada and embedded applications 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 Message-ID: Date: Mon, 4 Jun 2001 22:12:14 +0100 NNTP-Posting-Host: 62.252.147.14 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 991689079 62.252.147.14 (Mon, 04 Jun 2001 22:11:19 BST) NNTP-Posting-Date: Mon, 04 Jun 2001 22:11:19 BST Organization: ntlworld News Service Xref: archiver1.google.com comp.lang.ada:8093 Date: 2001-06-04T22:12:14+01: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. GNORT has been discontinued by ACT. Maybe they integrated it into GNAT. > 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. I suppose if i could keep exceptions in it'd be good since i'd know where the OS crashed. Still it I can't since GNAT must use some DOS or windows calls to display the point where the exception occured. This is really annoying me now. I didn't even consider exceptions when i settled on Ada for this project but now i can see they could be benefitial -- In Ada exceptions are always there letting you know when something goes barmy. > 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.) That's why i was curious and decided to find out why. I also wanted to put the guy right if need be. I still can't do that because I still don't know if Ada is less favoured when budgets are tight. It doesn't seem to me, from what's been said in this thread so far that exceptions take up that much extra memory and it shouldn't really matter(but then i've never programmed an embedded device before). If i were a program developer for a life support machine i'd rather use Ada than C. If the worst happened and someone died unneccessarily due to a bug, you'd stand a better chance of finding it with Ada. The other reason he gave i tend to agree with: it can be slow to develop compilers for new processors, but in some ways it can take a while to get a C compiler for the new processor, Ada however is much more complex than C and will take more time starting from scratch. Out of interest GNAT is based upon GCC i think and GCC compiles things to an intermediate form -- a RTL -- (is this right?) so all you'd really need to do is port specific parts of GNAT to the OS if any on the new processor and have a GCC backend that compiles to that processor. It seems like it really wouldn't take that long after you've got this. Is my understanding of this all barmy? Chris Campbell