Halting Problem

Late Bound

Part of Roland Sadowski's website

November 25th, 2008

Clojure goodies

Processing + Clojure

Processing is a java library for doing visualizations and various media related stuff. A while ago I did a Clojure wrapper for it. You can get it from github: clj-processing.

Cloak

A couple of months ago I saw examples of config files of ruby’s rake. Rake is a build tool, like ant or msbuild, but unlike those, it doesn’t involve editing XML files. And thanks to ruby’s quite flexible syntax, the resulting configuration files don’t hurt your eyes.

I don’t know ruby and didn’t really feel like learning it just for one tool. Googling for something similar to rake in the python universe didn’t yield any results.

Since I’m investing much time in Clojure lately, I decided that I might as well write something useful in it. Hence Cloak, a simplistic automation tool written in Clojure. It’s heavily inspired by rake; I had rake’s docs opened most of the time when writing the app.

Here’s how to use it. You put a file named CLOAK in your project’s directory, and in it you define tasks, like this:

(task :task-name [:other-task :another]
    (when (exists? "some.file")
        (rm  "some.file"))
    (sh "command arg1 arg2 arg3" :dofail))

Task name should be a keyword. To run it from the command line, type cloak task-name, without the semicolon (assuming cloak is the name of the shell script that launches cloak). Second argument to task is an optional list of dependencies, which can be other tasks or files. For example [:compile "classes/my.lib"]. To refer to a file, use it’s file name. Apart from regular tasks, you can specify file tasks:

 (file "index.html" ["template.xml" "content/main.txt"]
       (sh "genhtml template.xml content/main.txt index.html"))

file tasks differ from regular tasks in one detail: they compare modification time of the target and all its dependencies. Task is executed only if mtime of target < mtime of source.

Cloak is not a replacement for maven or ant. It would take me ages to reach the level of functionality of those tools. I just wanted something simple, to automate the generation of my website (among other things). So far, it’s still a work in progress but it’s usable enough for me to use it with my own projects.

Utility Libs

I’ve also put my utility libs on github. Cloak requires them (but has them in in a jar, so no need to download them separately). There’s some IO and math related stuff in there.

§

November 20th, 2008

Autumn Update

Since the end of the year is near, and because at the beginning of January I’ll be pretty busy with other things (see below), I decided I’ll post something while I still have spare time on my hands.

On a personal note, that was a good year (I finished school, among other things). On the professional level, well, I didn’t work anywhere, was too busy with my thesis. But in September I started sending out my CV and found something really nice. In Denmark.

I’m starting in January, that’s why I won’t have much time at the beginning of next year for fancy retrospectives. I’ll spend 1+ year in Denmark. I always wanted to live there, at least for a while. I mean, they invented Lego, best toy ever.

But till then, I have lots of free time and so far I’m spending it mostly on reading and programming. I’m gradually replacing Python with Clojure as my weapon of choice and I’ll post something on that topic shortly.

§