[nzlug] Whats The differance between
Bruce Clement
subscribed at gnuzealand.com
Tue Oct 17 15:32:55 NZDT 2006
Daniel Pittman wrote:
>
> Footnotes:
> [1] For the peanut gallery Cfront was the first C++ compiler. It
> targeted C, and depended on the platform C compiler to generate
> object code and perform the final linking stages.
>
> While modern C++ compilers do significantly more work, including a
> template meta-programming stage where they generate C++ code
> automatically, they are still essentially implementing this
> conceptual model.
Yes & no. cfront generated C code for two reasons, firstly it gave it a
"portable assembler" so it didn't have to target the assembly code of
multiple processors, and secondly it also meant that it could pass some C
constructs through effectively unchanged thus simplyfying the translation
effort.
The "portable assembler" concept isn't unique, for example the Intercal
compiler produces C as its output, and many portable compilers work by
outputting an intermediate representation of the program that is then fed
into a code generator which is retargetted as part of porting. I believe
that GCC works this way.
The C++ that Cfront translated was simpler than today's C++, C++ v 1.0
lacked templates (Although the C++ Language, 1st edition showed how to
build something like them with #defines) and exceptions.
It is claimed that it was the difficulty of translating exceptions to C that
was the cause of Cfront's development being abandonned.
ref: http://en.wikipedia.org/wiki/Cfront
--
OK, so I'm not the man you thought I was ... Is it my fault you're such a
lousy judge of character?
More information about the NZLUG
mailing list