Is D more complex than C++?

Don nospam at nospam.com
Mon Mar 28 22:58:07 PDT 2011


ToNyTeCh wrote:
> Seriously, I wanna know. How many lines of compiler code does it take for 
> each (Walt should have the best handle on this, surely)? The LOC is one 
> parameter, but I don't want just that -- it just came to mind while 
> typing the overall question. The intricacy of the compiler is much more 
> important thatn the LOC. (Is D's compiler more intricate than C++'s?). 
> Any facts, feelings, guesses, whatever, are all welcomed in response. The 
> complexity in regard to usage would be a good thing to hear about from 
> users of all levels of experience (with D and other languages). 

This is an interesting question. The difficulty in performing a direct 
comparison (LOC or similar) is that DMD still has some implementation 
gaps, so it will get bigger.

The parser for D is an order of magnitude simpler than C++, because it 
is completely separated from the semantic pass. In fact, generally this 
is true of the language: although there are some features that require a 
lot of code, they are generally well-contained. Templates are much 
simpler to implement than in C++, even though they are much more 
powerful, because they are well-contained.
So generally, the compiler is less intricate.

But in terms of LOC, by the time everything in D is fully implemented, I 
doubt that a D compiler will be significantly shorter than a C++ one.


More information about the Digitalmars-d mailing list