Update: the project made it to reddit's r/haskell!

As part of working at Galois, everyone gets two (specific) weeks a year to devote to whatever personal project(s) they're interested in. It's called "innovation week" and the first one this year is happening right now! This is similar to the well known Google 20% time.

I wanted to record what I'm doing during innovation week, hence this post. Originally I decided to write a short post each day about what I did, but it turns out that doing innovative stuff is hard and takes more than a day :)

Days 1-2

My co-worker Rogan Creswick and I thought it would be cool to work on a tool to support Haskell development in a mode similar to the IPython notebook. The IPython notebook is a really useful interactive computing environment that lets you rapidly iterate a Python development process and includes support for rich display of outputs (and even interactive outputs). The other feature I love is the ability to export a notebook for easy viewing (for a blog post or material for a tutorial, etc), see the IPython Notebook Viewer and this blog post for examples.

Our first idea for implementing this, the simplest thing that could work, was to use the IPthon Notebook itself and hook up the code cells and evaluation machanism to GHCi, the GHC interactive shell. Eventually we'd like to cut Python out of the loop and go for a web-based application that uses the GHC API directly.

It turns out that implementing the first idea wasn't too hard, we had a working prototype by the end of Day 1. It involves a lot of text munging. Our prototype consists of an IPython extension (a "cell magic") and a python module ghci2py that controlls an interactive GHCi session using pexpect.

screenshot

Check it out!

You can check out our work so far on GitHub

Even better, here's a static view of a working Haskell notebook I wrote today:

Misc

Previous ideas on this (from about a year ago):

These efforts are really polished, but don't let you do arbitrary computation. Their goals are different..

octocat


Comments

comments powered by Disqus