Aardvark is about putting a bunch of code files together in one file, and executing one command to do all that's necessary (compile, execute, launch on a cluster, ship accross the network,...) to produce the desired output.

Stop being a manager of files, but concentrate on code writing!


The 'itch' that led to me to the 'scratch' was the different development environments I had to open up, to run relatively simple code on a spark cluster, use python to copy the results from hdfs, and then use R to plot a nice chart from it. Noticing that switching between contexts, was not helping my concentration nor focus, I decided to put all the code together in one big code file, and use a utility (ie. aardvark) to split it up into smaller files.

So I 'cat'-ted all my source files into one file named aardvark.code, each entry separated by a line containing

##== <filename>

and ran aardvark on it.

NOTE: on Wed 1st Jun, the split pattern was changed from ##-- to ##== !

Now the number of windows opened in my development environment was reduced to just two terminal windows: one running vi to edit the code, and the other one to kick off the 'aardvark' command.

In this one file, aardvark.code you can also add your data, documentation, etc ..., it's like taking the object-orientated concept of encapsulation a step further: encapsulate not only the code, but also the data, documentation, and compilation/execution/test instructions together in one single file.

Another idea is to put what is important, or what changes a lot, close to the top, like a 'TL;DR' section or an executive summary.


  • less file management chores to do, concentrate on writing code
  • less context switching (from eclipse to r-studio to idle to the command-line to firefox to.. ) is good for the brain (google 'nytimes unitasking distraction': doing less but getting more done)
  • use the best bits of each world: db for data-manipulation, python as swiss-army, R for plotting charts, markdown for documentation, csv for data, golang for speed, .., and glue it together using aardvark
  • reduce your mouse usage, keep those fingers on the keyboard, and concentrate on the code
  • no need to wonder what script needs to be executed for kicking of the code in that directory: by convention it is always aardvark.sh
  • easy to work on a new (or refactored) version of a project while keeping the old one ready for execution and testing (just have 2 aardvark files eg. aardvark.code and old.code)

Writing code the 'aardvark' style is ideal for a number of relatively short scripts, that have disparate execution environments, and can all be executed from the command line.

Notes by Data Munging Ninja. Generated on akalumba:sync/20151223_datamungingninja/aardvarkcode at 2018-02-24 12:57