You are here
Back to the future: Haskell
(Before you ask: yes, I'm growing a beard, and yes, I'm using the lack of a Belgian government 250+ days after the elections as a lousy excuse.)
The last couple of months, I've been trying to get back to an old love of mine: Haskell. I haven't really used it for years until recently, but I'm planning to change that in the near future. I'll briefly outline my world-shocking (well, almost) plans here. But first, a bit of history...
Back in 2005, I used Haskell for my Masters thesis entitled "Modeling and implementing a ray tracer using functional languages", which resulted in HRay. Besides a couple of minor hiccups, I haven't really done anything serious with Haskell since. And it's not that I didn't want to, I just didn't find the time nor opportunities for it during my PhD. The tools I used for my research usually needed to chew through a large amount of data quickly and I decided to resort to C for that, because I didn't have enough experience with Haskell to produce tools that are competitive performance-wise with ones written in C.
During my PhD I promised myself I would get back to Haskell once I finished, and so I did.
I took my first steps back to Haskell during the Google AI Challenge, by putting together a bot in Haskell (code here) that played the contest version of Galcon against another bot. I relied on jaspervdj's Haskell starter package for the bare metal stuff. The bot ended at 497th place in the contest (6th Belgian, 6th Haskeller), a nice result with just over 4600 bots competing.
During BelHac, the first Belgian Haskell hackathon, I had some discussions about starting an effort for a new Haskell benchmark suite, i.e. one worthy of that name, and I also made some minor patches to HRay, which I had ignored for too long. I also met a couple of infamous Haskell hackers, including Don Stewart a.k.a. dons and Duncan Coutts , who helped me with some GUI-related stuff for HRay back in 2005. And last but not least, I won a copy of Real World Haskell (RWH), because I submitted stuff to Hackage during the hackathon and won the lottery draw. That earned me the right to be on a picture together with dons, see below (I'm on the left, dons is right next to me \o/). He even signed my copy of RWH, how cool is that!
Since BelHac, my hands have been itching to use Haskell for all sorts of things. My sysadmin job doesn't really allow using Haskell at work, I mostly use Python there, and finding time for side-projects isn't easy since my wife and 8-month old son are also competing for attention (and frankly, they are winning hands down over anything else). Nevertheless, I do have plans with Haskell in the near future.
First of all, I will be competing in the Flemish Programming Contest next month, and would like to do so using only Haskell. I found two team mates in the GhentFPG community, and we've been preparing for the contest for a couple of weeks now. We're hoping to blow the competition away by exploiting some of the strengths of Haskell, i.e. fast, obvious-bug-free programming, and chose the Haskell motto "Avoid Success At All Costs" as team name.
Something I would like to look into is using genetic programming to evolve Haskell programs. Recently, a Haskell library for genetic programming was announced on the Haskell mailing lists: genprog. I played with it for a while, and found the concept of being able to evolve expressions that evaluate to a specified value as closely as possible very interesting. There are several problems that come forward when trying to evolve actual Haskell programs, and although I have no idea what I'm getting myself into, I'd love to dive in and see what I can come up with. One idea I have that might turn out useful is to use Hoogle somehow to figure out how two existing Haskell programs can be recombined to form two others (the crossover operation in genetic algorithms).
Another Haskell-related project that I find interesting is looking into the low-level behavior of Haskell programs, and compare it to that of programs written in procedural languages. My attention was drawn to this after reading a tweet by dons, which pointed to excellent slides by David Peixotto on exactly this topic. David has compared the dynamic instruction mix of Haskell programs with that of programs written in C/C++, and found them to be remarkably different. Using MICA, a tool I implemented during my PhD that allows to collect so-called microarchitecture-independent workload characteristics, it would be interesting to compare not only the instruction mix, but also other aspects of low-level program behavior, e.g. the spatial and temporal locality of memory accesses, or the amount of instruction-level parallelism (ILP). I believe that kind of research could result in very interesting insights on how Haskell programs are different from programs in other languages, and might contribute to improving code generation for Haskell.