TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"S. Ron Oliver" <[log in to unmask]>
Sun, 28 Oct 2001 07:17:55 -0700
text/plain (34 lines)
At 11:16 AM 10/26/01 -0700, Steven wrote:
> From EdgeMailPOP3Server
>
>This probably doesn't answer/solve your question but I was just curious
>what's the advantage in converting the C programs to Ada? I mean.. if the C
>program works, isn't it better to just import the C program?

One might want to do this for some, if not all, of the
"ilities":  readability, maintainability, portability, enhance-ability,
reliability (run-time checks) and, depending on the code and compilers
involved, possibly even efficiency.  I have benchmarked some cases, for
instance, where code generated by GNAT performed better than comparable
code generated by the same vintage g++ compiler.

If the number of lines of code is large (which it probably is, or Gordon
wouldn't much care for a tool) one problem with doing an automatic ctoada
conversion is you generally get poor quality Ada code, because you are
limited to the very limited C syntax.  In a large body of C code there are
no doubt opportunities to dramatically simplify and improve the code by
re-writing it, taking advantage of Ada language features.  At the very
least, if the C code were well written in the first place, there are
probably many lines of code dedicated to range-checking, which could be
eliminated in favor of run time checks.  The run time checks can be
expected to be more thorough and can be turned off when the code is deemed
"proven".

sro
S. Ron Oliver, semi-retired professor of Computer Science and Computer
Engineering.  www.csc.calpoly.edu/~sroliver

caress Corporation is proud to be the U.S. representative for Top Graph'X,
developers of high quality software components, using Ada.  For more
information, check out www.topgraphx.com.

ATOM RSS1 RSS2