The D Programming Language

Source: Internet
Author: User
Some time ago, when I was planning to write a distributed component platform, I always wanted to rewrite C ++. However, C ++ was too complicated and gave up the project because of limited energy. however, we found a new language, D LanguageThis language has been coming out for a long time, but there are not many people in China who are interested in it. I will post it when I have time. I will share it with you.

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 have 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 each diverse ages, and attempting to construct large projects using those ages. d draws inspiration from those other programming ages (most especially C ++) and tempers it with experience and real world practicality.

Let's look at an example.
Import STD. file;

IntMain (Char[] [] ARGs)
{
IntW_total;
IntRochelle total;
IntC_total;

Printf ("lines words bytes file/N ");
Foreach (Char[] Arg; ARGs [1 .. args. Length])
{
Char[] Input;
IntW_cnt, l_cnt, c_cnt;
IntInword;
Input = cast (Char[]) STD. file. Read (ARG );

Foreach (CharC; input)
{
If(C = '/N ')
++ L_cnt;
If(C! = '')
{
If(! Inword)
{
Inword = 1;
++ W_cnt;
}
}
Else
Inword = 0;
++ C_cnt;
}
Printf ("% 8lu % 8lu % 8lu %. * s/n", l_cnt, w_cnt, c_cnt, ARG );
Rochelle total + = Rochelle CNT;
W_total + = w_cnt;
C_total + = c_cnt;
}
If(ARGs. length> 2)
{
Printf ("--------------------------------------/n % 8lu % 8lu % 8lu total ",
Rochelle total, w_total, c_total );
}
Return0;
}

Http://www.digitalmars.com/d/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.