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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a3ca574fc2007430 X-Google-Attributes: gid103376,public From: frank@bigdog.engr.arizona.edu (Frank Manning) Subject: Re: Ada and Automotive Industry Date: 1996/11/13 Message-ID: <56bnj9$ug2@news.ccit.arizona.edu>#1/1 X-Deja-AN: 196150470 references: <1996Nov12.192850.16867@ole.cdac.com> organization: College of Engineering and Mines, University of Arizona newsgroups: comp.lang.ada Date: 1996-11-13T00:00:00+00:00 List-Id: In article <1996Nov12.192850.16867@ole.cdac.com> james@cdac.com (James Thiele) writes: > Frank Manning writes: > >> It's a myth that Ada compilers are unrealistic for small >> microcontrollers. There's nothing that prevents anybody from >> implementing an Ada subset that could both (a) be validated and >> (b) fit harmoniously on a small machine. >> >>[...] > > An 8051 and other 8-bit processors are small even for C. I know > of only one target of gcc to a machine of this class, 68HC11. This > port has no floats or 4 byte longs. Don't forget it's possible to do useful work on the little guys even with an interpreted BASIC (I have), which includes full floating point. Otherwise nobody would make any money selling SBC's with built-in BASIC interpreters. It's difficult to find a less efficient language than that. > If you look at 8051 C compilers you will find that they have evolved > over the years adding little "hints" to deal with quirks in the > address space. The 8051 is a classic Harvard machine with different > code and data spaces. In addition, and here is one of the problems, > it handles on and off chip RAM differently. > > Since it has only one accumulator and one data pointer there is > likely going to be code bloat just trying to move data around. > If you read postings in the relevant newsgroups you will see > postings about features of C to avoid on the 8051 because they > are expensive. Well, that's true of any machine and any language. For example, if your target is an x86SX and the language is C, floating point is hugely more expensive than integer arithmetic. If the application requires you to squeeze as much performance as possible out of a machine, there's no substitute for intimate knowledge of the hardware quirks in any case. > Originally C was designed around PDP-11 class machines: 16 bits, > multiple registers, indirect addressing modes, etc. Since gcc has > to dumb down C for an 8-bit machine, how much would GNAT have > to dumb down Ada to target an 8051? Would you still think it was Ada? The important thing is from an economic point of view -- whether the subset still encourages good software engineering practices, and how easy it would be to retrain Ada programmers to use the subset effectively, compared to programmers in alternative languages. -- Frank Manning