What Makes A Programming Language Good

Adam Ruppe destructionator at gmail.com
Tue Jan 18 10:30:07 PST 2011


Vladimir Panteleev wrote:
> Then the question is: does the time you spent writing and maintaining
> makefiles and build scripts exceed the time it would take you to
> set up a build tool?

I never spent too much time on it anyway, but this thread prompted
me to write my own build thing. It isn't 100% done yet, but it
does basically work in just 100 lines of code:

http://arsdnet.net/dcode/build.d
Also depends on these:
http://arsdnet.net/dcode/exec.d
http://arsdnet.net/dcode/curl.d


The exec.d is Linux only, so this program is linux only too. When
the new std.process gets into Phobos, exec.d will be obsolete and
we'll be cross platform.

I borrowed some code from rdmd, so thanks to Andrei for that. I
didn't use rdmd directly though since it seems more script oriented
than I wanted.


The way it works:

build somefile.d

It uses dmd -v (same as rdmd) to get the list of files it tries
to import. It watches dmd's error output for files it can't find.

It then tries to fetch those files from  my dpldocs.info http
folder and tries again (http://dpldocs.info/repository/FILE).
If dmd -v completes without errors, it moves on to run the actual
compile.

All of build's arguments are passed straight to dmd.


In my other post, I talked about a configuration file. That
would be preferred over just using my own http server so we can
spread out our efforts. I just wanted something simple now to
see if it actually works well.


It worked on my simple program, but on my more complex program,
the linker failed...but about the stupid assocative array opapply.
Usually my hack to add object_.d from druntime fixes that, but not
here. I don't know why.

undefined reference to
`_D6object30__T16AssociativeArrayTAyaTyAaZ16AssociativeArray7opApplyMFMDFKAyaKyAaZiZi'

Meh, I should get to my real work anyway, maybe I'll come back to
it. The stupid AAs give me more linker errors than anything else,
and they are out of my control!


More information about the Digitalmars-d mailing list