Apache Ant is regrettably (?) using XML

I’ve done some Apache Ant build file hacking today and that made me recall that the original author of Ant, James Duncan Davidson, actually regretted using XML as the file format.

Mysteriously missing from today’s world wide web, but fortunately captured by the Wayback Machine, the blog entry Ant and XML is worth reading. The entry is concluded like this:

If I knew then what I knew now, I would have tried using a real scripting language, such as JavaScript via the Rhino component or Python via JPython, with bindings to Java objects which implemented the functionality expressed in todays tasks. Then, there would be a first class way to express logic and we wouldn’t be stuck with XML as a format that is too bulky for the way that people really want to use the tool.

Or maybe I should have just written a simple tree based text format that captured just what was needed to express a project and no more and which would avoid the temptation for people to want to build a Turing complete scripting environment out of Ant build files.

Both of these approaches would have meant more work for me at the time, but the result might have been better for the tens of thousands of people who use and edit Ant build files every day.

Hindsight is always 20/20.

The “real scripting language” part sounds just like Ruby’s build program Rake and “a simple tree based text format” sounds very much like YAML, a format well worth considering for hierarchical data structures.

Leave a Reply

Your email address will not be published. Required fields are marked *