Subject: Sake, because "YABT" is rubbish Time-stamp: <2005-03-24 11:51:04 mikeb> Renderer: renderstory
With define-syntax Scheme can be a very elegant dependency and building tool, providing both ease of use and the full power of a real programming language.
My colleagues and I actually did some proof-of-concept work based on Schelog. The idea is that we want our build descriptions to be mostly declarative (like "make", but more so), with the full reasoning/inferencing power of Prolog available to us. However, we also want to allow some procedural pieces (like "ant", but more so), with the full power of scheme available to us, and hook into Java to do the all the O/S interfacing and hook into existing "ant" scripts.
Mostly we were reacting to tools like Ant, for a few reasons (directed at Ant specifically; it's just easier to pick a target ;-): 1. Ant is headed in the direction of being a scripting language, and because of its configuration-centric (charitably: 'declarative') origins, it is stunted and awkward. For one thing XML is at a stretch ok for a configuration syntax, but horrible for a programming language syntax. 2. Ant is oriented along tasks, not outputs, so while it's notionally declarative it ends up mostly being procedural, with only implicit connections between outputs from one task and the inputs to another. For a build system that is inside-out. 3. Dependency tracking is implemented in the tasks, rather than being a separate concern. Ant gets it wrong occasionally, and there's nothing one can do but a fresh build. The obvious competitor is make. Our objections to make are pretty traditional: picky syntax, arcane, somewhat ad-hoc, C-oriented and can be verbose. There's a reason that people autotool their C projects. Our main objection to make, though, is that it is only really concerned with files as outputs, which have one attribute to match on -- the filename. We wanted more flexible ways of specifying dependencies; for example, by saying "files in this directory have to be checked out of CVS". One great thing about make is its dependency tracking; we also wanted to be able to reason from sources upwards -- to be able to say "build what you can from everything you're given", effectively. This kind of ability is useful for generating web sites statically for instance. So really, we wanted something like make, extended and generalised to - have a more abstract notion of an output; - be able to reason about dependencies - have a more manageable syntax - have modularised sets of (default) rules, with just a little specialisation needed for particular builds. The problem with accomplishing all these grand plans is that eventually you have to pin things down to something concrete.