About the front-end & dogfood

Jascha Wetzel firstname at mainia.de
Fri Mar 7 14:16:39 PST 2008


Bill Baxter wrote:
> About this: http://www.digitalmars.com/d/2.0/faq.html#dogfood
> """
> The front end is in C++ in order to interface to the existing gcc and 
> dmd back ends. It's also meant to be easily interfaced to other existing 
> back ends, which are likely written in C++.
> """
> 
> Aren't most compiler back-ends written in C, or at least come with a C 
> interface?  Given that basically nothing can call C++, not even C++ code 
> from another compiler, why would you seal your back end up in C++?
> 
> It's pretty obvious that front end writers are eventually going to want 
> to write their front ends in their target language, since everyone knows 
> the "eat your own dogfood" mantra.   So C is really the only logical 
> language choice for a general-purpose back-end interface.
> 
> Assuming I'm right and there is a C interface on any back end that 
> matters, there shouldn't be any problem writing the front end in D, just 
> extern(C) where necessary.
> 
> Right?

i'm not sure whether i understand the question, since of course it's 
possible to write D frontends in D - there are frontend projects in D.
there is also a C binding for LLVM and LLVM matters ;)



More information about the Digitalmars-d mailing list