On 12-03-27 23:13 ,
kalvi...@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.