A gentle critque..

Ben Cooley Ben_member at pathlink.com
Mon May 15 20:59:15 PDT 2006


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.

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.







More information about the Digitalmars-d mailing list