Ten Things I Like about D

Daren Scot Wilson darenw at darenscotwilson.com
Sun Jun 2 20:28:47 PDT 2013


What I like about D...

1) It is a compile-to-machine language, meaning high performance 
for general CPU code.

2) It can link to any library offering a C-style API, for 
example, OpenGL.  It is good that people are providing .d files 
with the necessary declarations, but if I can't find one, no big 
deal.  I can write my own.  (But I rarely need more than a 
fraction of most specialized libraries, so I have no .d files to 
offer for the benefit others.  If someone nags me, though, I 
would.)

3a) Unicode for identifiers.  I saw the discussion recently (May 
30th or so) and cast my vote in favor of allowing unicode 
characters for identifiers (and of course comments and string 
literals.)  I never knew any language allowed non-ASCII for 
variable or procedure names, until I played with Go about two 
years ago.  I thought, cool, as a physicist/engineer I can use 
lambda for wavelength, capital omega for longitude of the 
ascending node, etc.

3b) More Unicode for identifiers:  It's important to allow the 
Germans, the French, the Japanese who write code for their own 
personal research, or in-house code for their own company, to 
freely use the language they know best. I can see skipping 
Arabic, Hebrew and other right-to-left languages, since I can't 
picture how source code would be formatted or written without 
some brain-twisting. (I wonder how Arabic programmers deal with 
Python?)  But then, this is a topic I'm ignorant about.  Chinese 
and other languages with thousands of complicated-looking 
characters, whew, I don't know about those either.  But there's 
just no reason to force the Germans to give up "ü" to write "ue" 
just to please the American-invented ASCII alphabet.

(And maybe we could have string literals surrounded by a 
heterogenous pair „...“ or «...» instead of the ambigous 
identical twins "" (ascii 0x22) every language uses today?)

4) Ranges instead of iterators.  I'm undereducated about computer 
science, and have no profound enlightening thoughts about this.  
I'm just a practical graphics and physics guy who can only say I 
just like it better this way, compared to C++.

5) No more compiler-molassis like #include and bolted-on template 
syntax.  All languages, and it seems like *all* languages, but 
for C and C++, have some kind of module or package or something 
for making use of already-written libraries and components.   
Well, no, I remember (?) fooling around with Sather (or Sather-K) 
in 1998, and it too used textual inclusion of files, not unlike 
#include.

6) Fast compiling.  Like Ada95, Modula, Java, Go, Fortran, and 
any language.  No doubt due partly for reasons covered in #5, but 
also any language with some kind of sense to its syntax will 
compile "fast".   I like sensible syntax, especially with 
associative arrays, overloaded functions, and... well, everything 
beyond the primitive concepts in compile-to-machine languages.

7) Speaking of sensible syntax, C++ is very difficult to write 
tools for.  Example: Once upon a time, I say a class Alpha that 
contained within it curly declaration friend class Beta.   I go 
look for Beta - in the same header, and it declares friend class 
Alpha.  Each also had a member pointer to an instance of the 
other.   Cute. I wonder what it means?  Maybe is part of some 
"design pattern"?  So I slapped together a tool using Python and 
Ack (betterthangrep.org) to search for other cases like that.  I 
was lucky that our source was closely adhering to a standardized 
style, but with templates, macros, and all manner of wickedness 
allowed by C++ in general, I can see how creating a c++ static 
analysis tool could be a rough adventure.

8) Cool, I can write #!/usr/bin/env rdmd and have an executable 
script I can start from the command line, but run at 
compiled-code speed. (Except for the time rdmd takes to compile 
it, but plenty fast for the intended use-case.)

9) Unit tests built into the system.  Made easy enough for lazy 
programmers like me to actually write them!

10) Andrei Alexandrescu's book TDPL is one of the greatest works 
of literature ever conceived by mankind.  The Baghavad Gita, 
Shakespeare, Hemingway, etc are all going to fall away behind 
this marvelous work. Therefore, it makes sense for everyone to 
use D for all programming tasks, so that this great book will be 
of benefit to all!


More information about the Digitalmars-d mailing list