Question

Another thread had this quote

  1. Erlang VM BEAM and HiPE is written mostly in C.
  2. Linked-in drivers are written mostly in C. (They are plugged to VM and serves communication with outside world.)

I've read some opinions that Ada's strong typing, modularity, run-time checking, parallel processing etc. etc. are better than that of C.

Would Erlang compiled using Ada be noticably better or worse than the Erlang made with C?

Just a hypothetical Q.

Was it helpful?

Solution

Normally I'd throw a bunch of weasel-words at you on a topic like this, but it turns out this exact question has been studied (it's a .doc file. Sorry).

Rational had a compiler with a large amount of code in both languages, and a large amount of data compiled over several years on bug rates, fix times, etc. Out of curiosity, one of their engineers crunched the numbers.

The answer was "Development Costs of C Exceed Those of Ada". If you read past the summary title, you'd see that they figured writing the same code in Ada cost them about half what writing it in C cost.

I know that everyone reading this is anxious to poke holes in that conclusion. I was too. But they looked at darn near every angle I could think of in the report.

OTHER TIPS

"Better" in what way? Better as in faster? Better as in less bugs? Better as in more portable? Better as in more readable? Better as in more extensible?

For any suitable definition of "better" arguments can be made either way. However, it is just about sacred writ that no compiled language is more portable than C. Thus, if one of your goals is to make your application highly portable, C is an excellent choice.

More people understand C than Ada. Writing erlang extensions might be much harder if it was written in Ada, simply because fewer people are conversant with the language.

C code can be highly performant, but I am aware of no comparisons between C and Ada w/r to compiler optimizations.

Ada's type checking might be useful, or it could be a real problem. One presumes that a VM does it's own type checking on the pieces that matter to it. The overhead of RTTC in Ada could impose a completely unnecessary burden.

Perhaps, but what language was your Ada compiler written in? Ada? What about the compiler that write your FIRST Ada compiler?

At some point when you are building software, formal semantics and software processes are much more important than what language something was coded in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top