give it up for scons

May 19th, 2006

Isn't it nice when you have an idea of something that would improve your life (and possibly the lives of many others) and you think to yourself "well if I were to do it, it would take me lots of time and hassle, someone should do it" and then you discover no less that someone has already?

A while back I was praising ant for being an improvement over make. And it is, it's smoother, it's nicer, it's more suited to the needs we have from a build tool today, make is ancient afterall. But then ant has it's problems.. the xml configuration scripts are a bit cumbersome and unnecessarily complicated (I mean who actually enjoys writing xml?) aaaand it's java based. Nice for portability, bad for speed. If you're building eclipse and you set up ant to do it, big deal, it takes forever anyway, the overhead in a java build tool won't bother you. But if you have a dozen java source files and you're working on some small project, you could still use a build tool to keep building more streamlined and organized, but ant won't feel like such a great choice anymore. Because making one small change in a source file will launch ant to rebuild that class. And even though compiling java doesn't take that long, launching ant itself probably takes longer. So there's a tangible overhead. Launching the vm itself takes a little while.

So if I'm writing a java application, I'll still use ant (probably), because it's a java environment anyway. But if I want to automize building latex documents or conceivably anything that could use the power of a build tool, I'm going back to make, it's quicker both to write the script and at every launch. But since make is far from ideal, how about a python based build tool? Python is quick and powerful. The first time I thought of that must have been a few months ago. Fast forward to today and....

Enter scons. scons is a python build tool, just like I conceived. As I started looking at the manual, it seemed very c-centric (with java support as well). But, it turns out that scons ships with build definitions for many languages and compilers, including jar, qt, latex, tar, swig.. well you get the idea. Not only that, build definitions are just simple python files which are easy to write. So the next time I need a build tool, I'll definitely see how far I can get with scons.

:: random entries in this category ::

3 Responses to "give it up for scons"

  1. erik says:

    XML is so not my thing

    "aaaand it's java based"

    ^You had me there :D

  2. numerodix says:

    I resisted the urge to call this one.. insconsed in velvet :D

  3. [...] quite a few of them. I haven’t done an exhaustive review, but I’ve mentioned ant and scons in the past. They have their strengths, but the biggest problem, as always, is portability. If [...]