Thursday 13 May 2010

Programming Tools: Versioning (and magic)

The programming tools series of articles (which, I know, I promised I had already finished) relied heavily on the version control system at its heart.

Today I want to talk about a new feature of versioning: Magic Files

Imagine, I check into the version control system my source code (or a gif), I want the facility to say to the VCS "now give me the compiled code" (or "now give me a jpeg version of the gif"). The VCS - not me - should know how to generate the file I'm asking for. Because there should be rules which tell the VCS how to generate the file

Now, because we can make a rule that any such process should be side-affect free, once the VCS has generate the file, it can keep a copy of it, at least until one of the files that were used in generating it has changed. And there is nothing to say that the VCS has to wait for someone to ask for the file before it generates it - if it sees free processor time, the VCS can spawn compilation.

We can take this further: why not just check out your test results file: that would run every test and tell you how it did. And running an individual test [by looking at the individual test results log] would just check out the files it needed to run - which means only the files needed to perform a test would be compiled - leading to the optimal code-compile-test loop.

In short, I'm talking about merging the version control system and make.

Its a different world - and one which probably requires far more storage (and a few extra VCS features such as a 'regenerate' option to regenerate a file which for some reason went awry) - but one which feels to me more inherently usable, and which provides us with more records of exactly what has and hasn't been run.

No comments:

Post a Comment