A gentle critque..
Walter Bright
newshound at digitalmars.com
Mon May 15 21:13:42 PDT 2006
Ben Cooley wrote:
> In article <e4an5r$2reb$1 at digitaldaemon.com>, Walter Bright says...
>> Ben Cooley wrote:
>>> I would suggest that a standard C and C plus plus compiler and parser be
>>> integrated into D, and that it not "convert" files, but just parse them directly
>>> without modification. If the equivalent C or C plus plus construct is not
>>> available in D, D should provide a way of accessing that construct as a foreign
>>> object.
>> That is a good idea, and I've toyed with it. The problem with it is that
>> it pulls the rug out from other implementations of D. People won't want
>> to use them because they'll expect the dmd 'extension' of being able to
>> parse .h files directly.
>
> Hmmm... well I can certainly sympathize because I don't want to use DMD without
> that capability either. ;-) Truth is I can't.
>
> But my advice to those other implementations would be to just get cracking. The
> GCC implementation wouldn't have too much trouble For the others there are a
> variety of free versions of full CPP compilers out there.
g++ is the only free full C++ compiler out there.
> An alternative would be to compile C and CPP headers to a C/CPP pcode format
> which could be accessed by the D cpp interface. Part of the D compiler would
> comprehend certain foreign cpp constructs as part of the basic D compiler, while
> a simpler external parsing tool would actually generate a cpp pcode file.
There is no such thing as a simple C++ parsing tool. That's one of the
huge problems C++ has - you need a full compiler just to parse it. It
took 10 years for the various vendors just to get the preprocessor to be
standard compliant.
More information about the Digitalmars-d
mailing list