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/