tags:

views:

569

answers:

3

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.

A: 

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.

San Jacinto
I'm not sure what you are asking here. Most compiled languages, including all Ada compilers I am aware of, are self-hosted (written in themselves).
T.E.D.
My point was that eventually there is some derivative language other than the one you are using to write the current compiler, and you are using all of the insecurities that are inherent in using tools developed by other people... so I'm not sure what your point is... you go back far enough, and every ADA compiler has its roots in a lnaguage that isn't nearly as safe in any regard... and that older compiler will also include bugs...
San Jacinto
+3  A: 

"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.

Christopher
Generally, the more information a compiler has about a program, the easier it is for it to optimize code. Ada beats the pants off of C in that respect. However, how well any compiler actually optimizes depends more on how well the writers *want* it to optimize, so you aren't likely to see a lot of difference in practice.
T.E.D.
"Better what?" Good point. Thanks. ..I think in terms of speed, reliability, portability.. C or Ada written Erlang would probably be neck and neck. T.E.D. (below) references a doc that implies Ada may be a better business decision.
Paulb
The implications go beyond cost. For any product there are three variables: cost, quality, and time. If you hold two of those constant, you decide what the third is. So when they say "costs half" there is an implied "for the same quality and time". If you'd rather spend the same either way, you could instead get better quality or get the same quality done much faster.
T.E.D.
+5  A: 

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.

T.E.D.
Actually, despite my earlier comments, I really liked my time developing in ADA. I can fully see why the report would have the conclusion that it does.
San Jacinto
Ada being a less expensive development life cycle is contrary to my instinct. I thought supply-demand of C programmers would make them less expensive than relatively rare Ada programmers. Curious.
Paulb
I've done quite a bit of development in both languages, and can report no big difference in my paychecks.
T.E.D.
Over my career I've ported mixed Ada/C applications containing hundreds of thousands, nay, millions of lines of Ada and C from one platform to another -- adapting to a change of one or more of hardware, OS, or compiler. In every case far more effort was spent porting the C code. Anecdotally I'd say 80+ percent, even though C comprised a minority of the system's SLOCs. The core reason for this was having to readapt to all the system-specific idiosyncrasies. C is nicely portable when restricted to use as a "portable assembly language", but it rarely remains confined to that arena.
Marc C
that's very true, for some more links on this, see: http://stackoverflow.com/questions/984866/why-use-c/988366#988366
none