Template Metaprogramming Made Easy (Huh?)

Justin Johansson procode at adam-dott-com.au
Tue Sep 8 14:25:08 PDT 2009


Well I've been groking D for the best part of a mere 10 days now so I wouldn't like to make a naive comment but these my (random but related to this thread) thoughts so far ...

D is to C++ as Scala is to Java.

Always thought that constructors were tuples in disguise.  Was surprised to find that D is one of the few languages to realize it .. and, boy, not just value tuples, type tuples as well!  What a boon for meta-programming.

The very articulate Paul Graham writes in "The Hundred-Year Language"
http://www.paulgraham.com/hundred.html
"Though the situation is better in the sciences, the overlap between the kind of work you're allowed to do and the kind of work that yields good languages is distressingly small. ... types seem to be an inexhaustible source of research papers, despite the fact that static typing seems to preclude true macros-- without which, in my opinion, no language is worth using."
If I'm not mistaken, (LISP) macros**, metaprogramming, templates are different views of the same thing and any language which makes template metaprogramming easy is definitely worth it.
** Yes I know, there is nothing as pure as LISP macros but since I tend to lead a rather impure life 'D' has my attention now.

Given Martin Odersky awarded top ACM recognition
http://actualites.epfl.ch/index.php?module=procontent&func=display&id=2046
for Scala, FP etc, perhaps Walter Bright should be considered for a Fields Medal for D :-)
http://en.wikipedia.org/wiki/Fields_Medal

Lest this newsgroup slip into being just mutual appreciation society forum, I'd suggest that the seasoned D gurus go forth and evangelize the language by commenting back on that Reddit link.
http://www.reddit.com/r/programming/comments/9iidr/template_metaprogramming_made_easy_huh/

I really really hope that my current excitement with D continues and that another 30-60 days down the track I don't end up becoming disillusioned with D as I did with Scala.

-- Justin Johansson 



More information about the Digitalmars-d mailing list