Re: compiling C++ to C, was writing a compiler

Marco van de Voort <marcov@stack.nl>
Tue, 4 Nov 2008 14:35:28 +0000 (UTC)

          From comp.compilers

Related articles
[2 earlier articles]
Re: Writing a compiler Ibeam2000@gmail.com (Nick) (2008-10-26)
Re: Writing a compiler tony@my.net (Tony) (2008-10-31)
Re: Writing a compiler lkrupp@pssw.nospam.com.invalid (Louis Krupp) (2008-11-01)
Re: Writing a compiler marcov@stack.nl (Marco van de Voort) (2008-11-02)
Re: Writing a compiler lkrupp@pssw.com (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 marcov@stack.nl (Marco van de Voort) (2008-11-04)
Re: compiling C++ to C, was writing a compiler alexc@TheWorld.com (Alex Colvin) (2008-11-04)
Re: compiling C++ to C, was writing a compiler barry.j.kelly@gmail.com (Barry Kelly) (2008-11-05)
Re: compiling C++ to C, was writing a compiler lkrupp@pssw.nospam.com.invalid (Louis Krupp) (2008-11-05)
| List of all articles for this month |

From: Marco van de Voort <marcov@stack.nl>
Newsgroups: comp.compilers
Date: Tue, 4 Nov 2008 14:35:28 +0000 (UTC)
Organization: Stack Usenet News Service
References: 08-10-037 08-10-046 08-10-047 08-11-003 08-11-008 08-11-009 08-11-014 08-11-015
Keywords: C++
Posted-Date: 04 Nov 2008 12:51:47 EST

On 2008-11-03, Alex Colvin <alexc@TheWorld.com> wrote:
>>Tony said, "From what I've read, it seems that CFront couldn't implement
>>the whole language."
>
>>I said I thought it could, at least theoretically, although modern
>>compilers which implement the current standard all compile to machine code.
>
> Runtime and linker features such as exceptions and template instantiation
> would be very difficult to generate in C.


Templates are no problem, the C++ compiler instantiates them, and writes
them out in C code.


Exceptions are harder. Sure, it is doable in C, but would the resulting,
stack unwinding C be portable to a different compiler (IOW free of (ab)use of
specific ABI knowledge )?



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.