The D Programming Language is a new programming language defined by
WalterBright, who wrote the Zortech C++ (see
ZortechCpp) compiler which later became the
SymantecCpp compiler and is now the
DigitalMars C++ compiler.
The D Language is currently (June 2008) at version 2.0.
See this page on Walter's web site at
http://www.digitalmars.com/d/index.html for details of the D language.
Discussion of the D language and its development is on
news://news.digitalmars.com in a number of groups:
- digitalmars.D
- digitalmars.D.dtl
- digitalmars.D.bugs
- D.gnu
--
JohnFletcher
There is a wiki (Wiki4D):
and an OS code and project repository
I looked at it and I think it is a great language. It is small and simple, OO like Java but native executables (60 KB+), GC, interfaces, templates, closures, enums, dynamic arrays, hashes, switch(string) and a lot more. I have installed a wiki to support Walter's creation:
http://www.prowiki.org/wiki4d/wiki.cgi (350+ pages in Aug04). --
HelmutLeitner
According to
BjarneStroustrup, there have been at least a dozen languages called D.
http://www.research.att.com/~bs/bs_faq.html
Interesting, I was just yesterday thinking that it would be nice to be able to declare functions inside functions to support the simplification of complex if/then/else statements using
ExtractMethod refactoring. The idea here is to simplify/clarify the situation where you need to use a large number of local variables in a complex logical comparison and want to keep the expression(s) in the if/then/else statement(s) as short/simple/clear as possible. Without something that allows you to extract a method but still allow access to the local variables of the enclosing function scope, you are left with either passing everything you need into the extracted method (which often confuses things as much as just leaving the messy logical expression in-place), or making all the variables needed in the extracted method(s) instance variables of the enclosing class (confusing, too). Reading the D Language "Quick Comparison" table, I noticed that it supports the notion of "Nested Functions" which allow exactly the behavior desired. Serendipity is an interesting thing...
--
GeoffSobering
See NestedScopes.
Being able to nest function definitions is nice for all kinds of reasons (with full-strength
LexicalScoping, please), but in the scenario you describe, isn't the code trying to tell you that you're missing one or more classes with responsibility for the logic in the expression? Depending on what the result of the expression is for, maybe Strategy or State would be good patterns to use here. And anyway, isn't the better solution to "the situation where you need to use a large number of local variables in a complex logical comparison" to factor the code so that you only have a small number of local variables involved in a simple logical comparison?
See also
SymantecCpp DigitalMars
As a C++ programmer, the thing I like most about D is that it has both
GarbageCollection and automatic("stack") objects, which you can use to manage resources.
Indeed, the main emphasis of it is, I believe, to take the good bits of C++ and remove the crud, i.e., compatibility with C, platform dependent type sizes and preprocessor. While adding in various c++ features that exist at the library level into the core language, i.e., garbage collection, strings, collections.
D looks like a fantastic language, but it's not enough of an improvement over C++ to get me to learn it. If I want speed, I can be fairly productive in C++ using Boost et al. If I don't care much about speed, there are much more productive and high-level languages I can use like Ruby or Python. D seems to be in an uncomfortable middle area: equivalent or slightly slower performance than C/C++ but not substantially more productive.
If D had better standard libraries including a well-designed portable GUI frontend, I'd consider it for desktop app development. I think it could see some success there or in games, but only with more library work.
CategoryProgrammingLanguage