tooling quality and some random rant

bearophile bearophileHUGS at lycos.com
Sun Feb 13 04:59:53 PST 2011


Walter:

> In C++, you get essentially the same thing from g++:
> 
> /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start':
> (.text+0x20): undefined reference to `main'
> collect2: ld returned 1 exit status

Lot of people come here because they want a compiler+language better than C++ :-)
If you compile this:

void main() {
    writeln("Hello world");
}

Since some time dmd shows an error fit for D newbies:
test.d(2): Error: 'writeln' is not defined, perhaps you need to import std.stdio; ?

Probably many Python/JS/Perl/PHP/etc programmers that may want to try D don't know what a linker is. When they want to develop a large multi-module D program they must know something about how a linker works. But D has to scale down to smaller programs too, where there are only one or very few modules, written by not experts of C-class languages. In this situation more readable error messages, produced by dmd that catches a basic error before the linker, is probably useful.

Bye,
bearophile


More information about the Digitalmars-d mailing list