D Programming Language
来源:互联网 发布:微信广告制作软件 编辑:程序博客网 时间:2024/05/16 15:07
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.
Example: wc
This program is the D version of the classic wc (wordcount) C program. It serves to demonstrate how to read files, slice arrays, and simple symbol table management with associative arrays.
import std.file;int main (char[][] args){ int w_total; int l_total; int c_total; printf (" lines words bytes file/n"); foreach (char[] arg; args[1 .. args.length]) {char[] input;int w_cnt, l_cnt, c_cnt;int inword;input = cast(char[])std.file.read(arg);foreach (char c; input){ if (c == '/n')++l_cnt; if (c != ' ') {if (!inword){ inword = 1; ++w_cnt;} } elseinword = 0; ++c_cnt;}printf ("%8lu%8lu%8lu %.*s/n", l_cnt, w_cnt, c_cnt, arg);l_total += l_cnt;w_total += w_cnt;c_total += c_cnt; } if (args.length > 2) {printf ("--------------------------------------/n%8lu%8lu%8lu total", l_total, w_total, c_total); } return 0;}
- The D Programming Language
- D Programming Language
- D programming language by Digital Mars
- D programming language 0.164 by Digital Mars
- codeforces 200D Programming Language 字符串处理
- codeforces 200 D Programming Language(stl)
- Programming Language
- D programming language v0.162 by Digital Mars
- D programming language v0.163 by Digital Mars
- D programming language v0.166 by Digital Mars
- D programming language v 1.010 by Digital Mars
- The D Programming Language.pdf 英文原版 免费下载
- D language
- The Curl Programming Language
- The Curl Programming Language
- The Programming Language Tips
- Perl Programming Language
- The Programming Language Idioms
- 初识mind-mapping
- 我的大学
- 日本宣布红外线激光器的3D显示技术
- 整理一个ANT在J2EE项目中的应用,含预编译JSP和打包WAR/EAR文件!
- 在职程序员为啥比不过在野程序员
- D Programming Language
- C++中delegate(委托)的实现
- 祝本命年的小狗们都健康快乐!
- Prison Break
- 情人节送玫瑰花数的含义,男的必看。(转)
- SQL Serve中SQL语句执行Access中子SQL语句
- 中文编码整理
- 代码才是真正有价值的东西??
- 生活中常用的五星级英文句子