What are the worst parts of D?

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 24 22:08:38 PDT 2014


On Wed, Sep 24, 2014 at 09:44:26PM -0700, Walter Bright via Digitalmars-d wrote:
> On 9/24/2014 9:26 PM, Andrei Alexandrescu wrote:
> >The build system that will be successful for D will cooperate with
> >the compiler, which will give it fine-grained dependency information.
> >Haskell does the same with good results.

I didn't specify *how* the build system would implement automatic
dependency now, did I? :-) Nowhere did I say that the build system will
(re)invent its own way of deriving source file dependencies.  FYI, Tup
is able to tell exactly what file(s) are read by the compiler in
compiling a particular program (or source file) automatically, thus its
dependency graph is actually accurate, unlike some build systems that
depend on source-level scanning, which would lead to the problems you
describe with conditional local imports.


> There's far more to a build system than generating executables. And
> there's more to generating executables than D source files (there may
> be C files in there, and C++ files, YACC files, and random other
> files).
> 
> Heck, dmd uses C code to generated more .c source files. I've seen
> more than one fabulous build system that couldn't cope with that.

Which build system would that be? I'll be sure to avoid it. :-P

I've written SCons scripts that correctly handles automated handling of
auto-generated source files. For example, a lex/flex source file gets
compiled to a .c source file which in turn compiles to the object file
that then gets linked with the executable.

Heck, I have a working SCons script that handles the generation of
animations from individual image frames which are in turn generated by
invocations of povray on scene files programmatically generated by a
program that reads script input and polytope definitions in a DSL and
computes each scene file. The image generation includes scripted
trimming and transparency adjustments of each individual frame,
specified *in the build spec* via imagemagick, and the entire process
from end to end is fully automatically parallelized by SCons, which is
able to correctly sequence each step in a website project that has
numerous such generation tasks, interleaving multiple generation
procedures as CPUs become free without any breakage in dependencies.
This process even optionally includes a final deployment step which
copies the generated files into a web directory, and it is able to
detect steps for which the products haven't changed from the last run
and elide redundant copying of the unchanged files to the web directory,
thus preserving last-updated timestamps on the target files.

So before you bash modern build systems in favor of make, do take some
time to educate yourself about what they're actually capable of.  :-)
You'll be a lot more convincing then.


> Make is the C++ of build systems. It may be ugly, but you can get it
> to work.

If you like building real airplanes out of Lego pieces, be my guest. Me,
I prefer using more suitable tools. :-P


T

-- 
The diminished 7th chord is the most flexible and fear-instilling chord. Use it often, use it unsparingly, to subdue your listeners into submission!


More information about the Digitalmars-d mailing list