截至2012年2月,似乎最不发达国家并不是一个真正可行的选择(至少在Debian上) .
例如,考虑D book中的第一个程序:
import std.stdio;
void main(string[] args)
{
writeln("Hello, world!");
}
这将无法在我的系统上使用LDC进行编译:
hello.d(24): Error: module stdio cannot read file 'std/stdio.d'
dlang.org的第一个项目也是如此:
import std.stdio;
void main() {
ulong lines = 0;
double sumLength = 0;
foreach (line; stdin.byLine()) {
++lines;
sumLength += line.length;
}
writeln("Average line length: ",
lines ? sumLength / lines : 0);
}
这是因为我的最不发达国家不支持Phobos--the current D runtime library . 看起来有可能构建一个D2版本的LDC,包括Phobos,但这不是它至少在Debian上发布的方式 .
GDC,当然还有DMD,都编译上面就好了 . 看起来GDC是最新的(两个月前DMD发布了2.057,GDC现在支持它) .
对我来说,GDC是显而易见的选择,因为简单的' apt-get -V install gdc '带来了编译器和Phobos运行时没有问题(在Debian unstable上测试) .