首页
社区
课程
招聘
D programming language by Digital Mars
发表于: 2005-12-4 16:33 2721

D programming language by Digital Mars

2005-12-4 16:33
2721
Description:

What is D?
D is a general purpose systems and applications programming language. It is a higher level language than C++, but retains the ability to write high performance code and interface directly with the operating system API's and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology.
D is not a scripting language, nor an interpreted language. It doesn't come with a VM, a religion, or an overriding philosophy. It's a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.

D is the culmination of decades of experience implementing compilers for many diverse languages, and attempting to construct large projects using those languages. D draws inspiration from those other languages (most especially C++) and tempers it with experience and real world practicality.  

Why D?
Why, indeed. Who needs another programming language?
The software industry has come a long way since the C language was invented. Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. Meanwhile, both C and C++ undergo a constant accretion of new features. These new features must be carefully fitted into the existing structure without requiring rewriting old code. The end result is very complicated - the C standard is nearly 500 pages, and the C++ standard is about 750 pages! C++ is a difficult and costly language to implement, resulting in implementation variations that make it frustrating to write fully portable C++ code.

C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets. While the code is usually portable from compiler to compiler, it can be hard to port it from programmer to programmer. A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.

C++ implements things like resizable arrays and string concatenation as part of the standard library, not as part of the core language. Not being part of the core language has several suboptimal consequences.

Can the power and capability of C++ be extracted, redesigned, and recast into a language that is simple, orthogonal, and practical? Can it all be put into a package that is easy for compiler writers to correctly implement, and which enables compilers to efficiently generate aggressively optimized code?

Modern compiler technology has progressed to the point where language features for the purpose of compensating for primitive compiler technology can be omitted. (An example of this would be the 'register' keyword in C, a more subtle example is the macro preprocessor in C.) We can rely on modern compiler optimization technology to not need language features necessary to get acceptable code quality out of primitive compilers.

home:

http://www.digitalmars.com/d/overview.html

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 1
支持
分享
最新回复 (6)
雪    币: 213
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
D语言?好用吗?有人试过吗?
2005-12-4 20:10
0
雪    币: 234
活跃值: (104)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
过了这么久了,仍旧有大量的fortran代码在运行。

Sample D Program (sieve.d)
/* Sieve of Eratosthenes prime numbers */

bit[8191] flags;

int main()
{   int i, count, prime, k, iter;

    printf("10 iterations\n");
    for (iter = 1; iter <= 10; iter++)
    {        count = 0;
        flags[] = 1;
        for (i = 0; i < flags.length; i++)
        {   if (flags[i])
            {        prime = i + i + 3;
                k = i + prime;
                while (k < flags.length)
                {
                    flags[k] = 0;
                    k += prime;
                }
                count += 1;
            }
        }
    }
    printf ("\n%d primes", count);
    return 0;
}
2005-12-4 20:35
0
雪    币: 217
活跃值: (99)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
4
最初由 auser 发布
Sample D Program (sieve.d)
/* Sieve of Eratosthenes prime numbers */
........


这个是D语言?好像是C语言的加强版.
2005-12-4 21:37
0
雪    币: 97697
活跃值: (200734)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
5
最初由 auser 发布
过了这么久了,仍旧有大量的fortran代码在运行。

Sample D Program (sieve.d)
/* Sieve of Eratosthenes prime numbers */

........


Each language has it use. But the development is not easy.
2005-12-4 21:41
0
雪    币: 217
活跃值: (99)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
6
感觉D语言吸取了许多语言的优秀特点,尤其是C.
针对底层添加了以前C语言稍有缺陷的一些特性,例如bit类型.

不过很怀疑是否真有发展,是否有商业上的支持.
2005-12-4 21:48
0
雪    币: 97697
活跃值: (200734)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
7
最初由 dwing 发布
感觉D语言吸取了许多语言的优秀特点,尤其是C.
针对底层添加了以前C语言稍有缺陷的一些特性,例如bit类型.

不过很怀疑是否真有发展,是否有商业上的支持.


这不是在作广告,我自己觉得不错。

Each language has it use. But the development is not easy.
2005-12-4 21:59
0
游客
登录 | 注册 方可回帖
返回
//