简单地说,D语言是一门新的编程语言,包含了C++、C# 跟 Java的长处,补充了它们的不足。
D语言的作者 Walter Bright (就一个人哦,暴强!!!)是大名鼎鼎的Symantec C++ compiler的作者,所以这门语言还是值得期待的。
目前的版本是D 0.103,Oct 20, 2004. (关注中, 期待新版本...)
其主页上介绍的特性很多,在我看来,主要还是其垃圾回收机制:
与C++相比,D语言采用了垃圾回收机制(GC),将程序员从指针堆里解放出来;
与C#/Java相比,其垃圾回收机制不需要虚拟机,运行速度提高,依赖性降低;
是C/C++的高效性与JAVA的安全性之结合。
D语言与其他语言功能比较表:
http://www.digitalmars.com/d/comparison.html
Feature
No
No
Yes
Yes
Functions
Function delegates
No
No
Yes
No
Function overloading
No
Yes
Yes
Yes
Out function parameters
Yes
Yes
Yes
No
Nested functions
No
No
No
No
Function literals
No
No
No
No
Dynamic closures
No
No
No
No
Arrays
Lightweight arrays
Yes
Yes
No
No
No
No
No
Arrays of bits
No
No
No
No
No
Yes
Yes
Array slicing
No
No
No
No
Array bounds checking
No
No
Yes
Yes
Associative arrays
No
No
No
No
No
No
No
No
String switches
No
No
Yes
No
Aliases
Yes
Yes
No
No
OOP
Yes
No
Yes
Yes
Yes
Multiple Inheritance
No
No
Yes
No
No
No
Yes
Yes
Yes
Operator overloading
No
Yes
Yes
No
No
Yes
Yes
Yes
Dynamic class loading
No
No
No
Yes
Yes
Nested classes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Covariant return types
No
Yes
No
No
Properties
No
Yes
No
Performance
Yes
Yes
No
No
Direct access to hardware
Yes
Yes
Yes
No
No
Lightweight objects
Yes
Yes
Yes
No
Explicit memory allocation control
Yes
Yes
No
No
Independent of VM
Yes
Yes
Yes
No
No
Direct native code gen
Yes
Yes
Yes
No
No
Generic Programming
Templates
No
Yes
No
No
No
No
No
typeof
No
No
Yes
No
foreach
No
No
Yes
No
Constraints
No
No
No
No
Reliability
No
No
No
Unit testing
No
No
No
No
Static construction order
No
No
Yes
Yes
Guaranteed initialization
No
No
Yes
Yes
RAII (automatic destructors)
No
Yes
Yes
No
Exception handling
No
Yes
Yes
Yes
try-catch-finally blocks
No
No
Yes
Yes
Thread synchronization primitives
No
No
Yes
Yes
Compatibility
C-style syntax
Yes
Yes
Yes
Yes
Yes
Enumerated types
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
No
Complex and Imaginary
Yes
No
No
Direct access to C
Yes
Yes
No
No
Yes
Yes
Yes
No
No
Struct member alignment control
No
Generates standard object files
Yes
Yes
Yes
No
No
Macro text preprocessor
Yes
Yes
No
No
Other
Conditional compilation
Yes
Yes
Yes
No
Unicode source text
Yes
Yes
Yes
Yes
D语言主页:
http://www.minddrome.com/produtos/d/
C#与C、C++、D、Java 的性能比较(中文)
http://mag.vchelp.net/200312/fanyi.htm
OSNews.com的介绍:
http://www.osnews.com/story.php?news_id=6761
D语言编译器下载: