Why D is not popular enough?

Guillaume Piolat via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 12 02:38:13 PDT 2016


On Thursday, 11 August 2016 at 15:41:42 UTC, Edward Diener wrote:
>
> 4) As a C++ programmer largely interested in C++ template 
> programming, C++ concepts etc., and potential 
> compile-time/run-time introspection, I have never found a 
> compelling reason to use D rather than C++. I do recognize that 
> C++'s template syntax is difficult and abstruse but I do not 
> and have never seen where D improves upon these matters in any 
> serious and rigorous way. This may be because the documentation 
> about these areas in D is either very light or almost 
> completely lacking. Even in Mr. Alexandrescu's book the 
> discussion of these areas was very light in my estimation. So 
> whatever D has to offer in these areas, if there are really 
> impovements, is either lacking in the D documentation or does 
> not really exist for me.
>

 From the best of my knowledge you cannot do these things in in 
C++:

https://p0nce.github.io/d-idioms/#Precomputed-tables-at-compile-time-through-CTFE
https://p0nce.github.io/d-idioms/#Enumerate-fields-with-__traits(allMembers)-and-static-foreach
https://p0nce.github.io/d-idioms/#Embed-a-dynamic-library-in-an-executable
https://p0nce.github.io/d-idioms/#Recursive-Sum-Type-with-matching
https://p0nce.github.io/d-idioms/#String-interpolation-as-a-library
https://p0nce.github.io/d-idioms/#Using-std.typecons.Flag-like-a-pro
https://p0nce.github.io/d-idioms/#Voldemort-types

Another expose of what you can achieve with these feature is the 
"D Cookbook" book.

- Chapter 6 Forwarding methods with opDispatch
- Chapter 8 Getting a list of child classes
- Chapter 8 Determining if a module is available
- Chapter 8 Using user defined attributes
- Chapter 9 Creating user-defined literals
- Chapter 9 Generating data structure from text diagrams


Finally what we label "DbI" is quite the game changer: 
https://p0nce.github.io/d-idioms/#Design-by-Introspection






More information about the Digitalmars-d mailing list