Translating Ruby’s Rake to Python

Martin Fowler wrote an introduction to the Rake (Ruby-Make), attesting to the power of Ruby as a tool for constructing domain specific languages.

Here’s an example of a Rake definition:

task :test => [:compile, :dataLoad] do
  # run the tests
end

The above expresses test as a dependency on compile, and dataLoad.

In Python, it’ll read like this:

task( {'test': ['compile', 'dataLoad']},
  lambda:
    # run the tests
)

This is the first time I find another language being prettier than Python.

Leave a Reply