CObject
驱动大牛
驱动大牛
  • 注册日期2002-08-18
  • 最后登录2017-07-22
  • 粉丝0
  • 关注0
  • 积分14分
  • 威望106点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
  • 社区居民
阅读:1077回复:4

D语言

楼主#
更多 发布于:2004-07-18 09:42
http://www.digitalmars.com/d/
[img=501x116]http://www.driverdevelop.com/forum//upload/CObject/2004-01-13_2.jpg[/img]
jec017
驱动太牛
驱动太牛
  • 注册日期2002-08-22
  • 最后登录2008-01-09
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-07-19 08:46
看起来超强哦!
jec017
驱动太牛
驱动太牛
  • 注册日期2002-08-22
  • 最后登录2008-01-09
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-07-19 08:48
Notes
C Language Specification
ANSI/ISO/IEC 9899-1999 (a.k.a. C99)

C++ Language Specification
ISO/IEC 14882-1998 (a.k.a. C++98)

C# Language Specification
ECMA-334

Java Language Specification
"The Java Language Specification" by Gosling, Joy, and Steele, Addison-Wesley, ISBN 0-201-63451-1

Object Oriented
This means support for classes, member functions, inheritance, and virtual function dispatch.

Inline assembler
Many C and C++ compilers support an inline assembler, but this is not a standard part of the language, and implementations vary widely in syntax and quality.

Interfaces
Support in C++ for interfaces is weak enough that an IDL (Interface Description Language) was invented to compensate.

Modules
Many correctly argue that C++ doesn't really have modules. But C++ namespaces coupled with header files share many features with modules.

Garbage Collection
The Hans-Boehm garbage collector can be successfully used with C and C++, but it is not a standard part of the language.

Design by Contract
The Digital Mars C++ compiler supports Design by Contract as an extension. Compare some C++ techniques for doing DbC with D.

Resizeable arrays
Part of the standard library for C++ implements resizeable arrays, however, they are not part of the core language. A conforming freestanding implementation of C++ (C++98 17.4.1.3) does not need to provide these libraries.

Built-in Strings
Part of the standard library for C++ implements strings, however, they are not part of the core language. A conforming freestanding implementation of C++ (C++98 17.4.1.3) does not need to provide these libraries. Here's a comparison of C++ strings and D built-in strings.

Strong typedefs
Strong typedefs can be emulated in C/C++ by wrapping a type in a struct. Getting this to work right requires much tedious programming, and so is considered as not supported.

Use existing debuggers
By this is meant using common debuggers that can operate using debug data in common formats embedded in the executable. A specialized debugger useful only with that language is not required.

Struct member alignment control
Although many C/C++ compilers contain pragmas to specify struct alignment, these are nonstandard and incompatible from compiler to compiler.
The C# standard ECMA-334 25.5.8 says only this about struct member alignment: "The order in which members are packed into a struct is unspecified. For alignment purposes, there may be unnamed padding at the beginning of a struct, within a struct, and at the end of the struct. The contents of the bits used as padding are indeterminate." Therefore, although Microsoft may have extensions to support specific member alignment, they are not an official part of standard C#.

Support all C types
C99 adds many new types not supported by C++.

80 bit floating point
While the standards for C and C++ specify long doubles, few compilers (besides Digital Mars C/C++) actually implement 80 bit (or longer) floating point types.

Mixins
Mixins have many different meanings in different programming languages. D mixins mean taking an arbitrary sequence of declarations and inserting (mixing) them into the current scope. Mixins can be done at the global, class, struct, or local level.

C++ Mixins
C++ mixins refer to a couple different techniques. The first is analogous to D's interface classes. The second is to create a template of the form:
template <class Base> class Mixin : public Base
{
   ... mixin body ...
}
D mixins are different.

Comparison with Ada
James S. Rogers has written a comparison chart with Ada.

Inner (adaptor) classes
A nested class is one whose definition is within the scope of another class. An inner class is a nested class that can also reference the members and fields of the lexically enclosing class; one can think of it as if it contained a 'this' pointer to the enclosing class.
jec017
驱动太牛
驱动太牛
  • 注册日期2002-08-22
  • 最后登录2008-01-09
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-07-19 14:28
这么好的语言,怎么就没有人用呢?
jec017
驱动太牛
驱动太牛
  • 注册日期2002-08-22
  • 最后登录2008-01-09
  • 粉丝0
  • 关注0
  • 积分91分
  • 威望10点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-07-19 14:30
这么好的语言,怎么就没有人用呢!!?
游客

返回顶部