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=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f6125e9594f9968 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.156.18 with SMTP id u18mr1119678bkw.3.1332952599347; Wed, 28 Mar 2012 09:36:39 -0700 (PDT) Path: h15ni59525bkw.0!nntp.google.com!news2.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada to C translator for small microcontrollers Date: Wed, 28 Mar 2012 19:36:37 +0300 Organization: Tidorum Ltd Message-ID: <9tgt0lFqtU1@mid.individual.net> References: <2424259e-cf1c-408e-a57e-f2c948087186@i2g2000vbv.googlegroups.com> <18324383.19.1332841560517.JavaMail.geo-discussion-forums@vbht7> <26305817.1823.1332879226490.JavaMail.geo-discussion-forums@vbiz13> Mime-Version: 1.0 X-Trace: individual.net nWyfCo73+FuZIl4FVGoB0QipL8Id16t3k4OG7cD50mi+79lGYQ Cancel-Lock: sha1:HlRbTR6GzI8/LD3BYYR+vjomXCw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <26305817.1823.1332879226490.JavaMail.geo-discussion-forums@vbiz13> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-03-28T19:36:37+03:00 List-Id: On 12-03-27 23:13 , kalvin.news@gmail.com wrote: > tiistaina 27. maaliskuuta 2012 20.22.07 UTC+3 an...@att.net > kirjoitti: >> Full language translators are mostly used to move a project away >> from one language to another more accessable language. So, why use >> Ada in the first place. Because it is so much better than C, of course :-) I know of more than one project that used Ada as a high-level design and specification language, and then implemented the design in some lower-level language (in one case, an assembly language). In some cases, the Ada code was complete and runnable and could be used as a test oracle for the lower-level implementation. > This is a very valid question. How large a software project needs to > be in order to benefit from implementing it in Ada? IMO, basically there is no lower limit, with the possible exception of the null program. > Is it only a one > person prjoect, two person project or project involving a small team. > Why bother with Ada as we already have (free) C compiler avaiable. We also have a free Ada compiler available, for many platforms -- but not for many small processors, I grant. But many projects developing in C for microcontrollers use non-free, commercial compilers, IDEs, and other expensive tools (in-circuit debuggers, etc.) The question IMO is not whether there is a benefit from using the Ada language; the question is if the benefit can be convincingly quantified in money and schedule terms. > If the project is a small one, and you don't have to share the code > with others, C is just fine. No! C is a like a Model-T Ford that for some strange reason is allowed on modern roads. You can survive and not be too uncomfortable on short trips, but you should really consider changing to a better car. IMO the only reasons that would make me use C instead of Ada are: - No Ada compiler available within my budget - Need to use large C libraries/APIs for which no Ada binding exists. > I do realize, that it might be almost impossible to produce efficient > C source translation for corresponding Ada, compared to corresponding > assembly. It is true that C does not provide all the features of assembly language, for all that it is called a "portable assembler". But I'm not sure that this would be a large handicap for an Ada compiler that uses C as an intermediate language (like the SofCheck one). The C level could be a performance bottleneck if one wanted to support wider numbers in Ada than the C compiler supports -- for example, an Ada 64-bit Long_Integer with a C compiler that supports only 32-bit integers -- but this is a marginal effect, I think. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .