|[5 earlier articles]|
|Re: Writing a compiler firstname.lastname@example.org (Manuel Collado) (2008-10-24)|
|Re: Writing a compiler Ibeam2000@gmail.com (Nick) (2008-10-26)|
|Re: Writing a compiler email@example.com (RR) (2008-10-26)|
|Re: Writing a compiler firstname.lastname@example.org (andresj) (2008-10-29)|
|Re: Writing a compiler email@example.com (kamal) (2008-10-29)|
|Re: Writing a compiler firstname.lastname@example.org (Tony) (2008-10-31)|
|Re: Writing a compiler email@example.com (Louis Krupp) (2008-11-01)|
|Re: Writing a compiler firstname.lastname@example.org (Marco van de Voort) (2008-11-02)|
|Re: Writing a compiler email@example.com (Chris Dollin) (2008-11-03)|
|Re: Writing a compiler firstname.lastname@example.org (Louis Krupp) (2008-11-03)|
|Re: Writing a compiler alexc@TheWorld.com (Alex Colvin) (2008-11-03)|
|Re: compiling C++ to C, was writing a compiler email@example.com (Marco van de Voort) (2008-11-04)|
|Re: compiling C++ to C, was writing a compiler alexc@TheWorld.com (Alex Colvin) (2008-11-04)|
|[7 later articles]|
|From:||Louis Krupp <firstname.lastname@example.org>|
|Date:||Sat, 01 Nov 2008 12:06:54 -0600|
|References:||08-10-037 08-10-046 08-10-047 08-11-003|
|Posted-Date:||01 Nov 2008 20:41:56 EDT|
> "Nick" <Ibeam2000@gmail.com> wrote in message
>>> Just use XSLT to generate the assembler code.
>> If I can make a suggestion, use C or C++ as target language. Here
>> you don't have to reinvent subroutine calling and the like, and you
>> maintain compatibility with other things on the OS. Not to mention
>> ease of moving around different OSes. And troubleshooting. Much
> I want to do exactly that to experiment with language features, but I
> don't really know where to begin. Probably studying how CFront
> generated C code? From what I've read, it seems that CFront couldn't
> implement the whole language. How could it when introducing something
> like '::' as the scoping operator when C doesn't have such a beast?
> [cfront was a prototype, and it's a miracle it worked as well as it did.
> If you want to see generated code, either get the Comeau compiler, or look
> at the assembler output from something like GCC. -John]
Look up "name mangling." It's as ugly as it sounds, but as far as I
know, it's how all C++ compilers manage scoping and overloading.
I see no reason why cfront couldn't implement all of C++;
theoretically, there's no difference between generating C or assembler
code. My guess is that all newer C++ compilers are "native" (i.e.,
they generate assembler), and cfront compilers may have predated later
versions of C++. So while there could be up-to-date cfront compilers,
in the real world, there may very well be none.
(One of the problems with cfront -- actually, the only problem I can
really articulate -- is that it depends on C. I've seen cfront generate
good C code which failed when fed to a buggy C compiler.)
Return to the
Search the comp.compilers archives again.