GSOC 2012 Project Proposal - GHCi in the web browser

The Google Summer of Code 2012 is looming on the horizon and it is time to think about project proposals related to Haskell. This year, I have a cool idea for a project that I’m willing to mentor.

Addendum: An updated version of the proposal can now be found on the Summer of Code Trac.

Project title: “GHCi in the web browser”

Description: Imagine that you’re drawing a picture in Haskell with the diagrams package. Wouldn’t it be awesome if you could just enter the expression into GHCi and it would draw the picture right there, like this?

And what about entering a function of type Double -> Double in the interpreter and immediately seeing a graph of it?

Or maybe you want to hear a sound that you just described in Haskell?

I think that would be totally cool!

This project is about making the awesome a reality. Namely, the goal is to create a Haskell interpreter that is capable of displaying pictures, animations and even interactive programs. The only limits are your imagination and your coffee supply!

Now, you may say, that is all well and swell, but the devil is in the details. How do I mean to realize a dream like this?

Concerning technology, the new interactive interpreter will be implemented in two parts: the GUI is presented as a HTML page in the web browser and a local server will perform the evaluation of Haskell expressions.

For software that is intended to be used on the desktop, this is a rather convoluted choice of technology. However, it is also the most pragmatic choice as it allows for the widest possible adoption. Instead of firing up a terminal with GHCi, you can now fire up your web browser and point it to your local GHCw server. Moreover, modern text editors and IDEs like TextMate or Xcode have already begun to integrate HTML viewers, so this can be used from existing and future development environments.

Furthermore, note that we are not starting from scratch, other people have already done some hard work in this area. For instance, there is Chris Done’s TryHaskell online interpreter and Péter Diviánszky’s activehs online courses. More on the IDE side, there is the scion server that deals with type checking and IDE functionality. Abstractions like Conal Elliott’s tangible values will come in handy to express interactivity.

Project scope: Of course, the success of a Summer of Code project depends first and foremost on the skills of the student programmer. But a solid plan and a little guidance can go a long way.

The ideal student candidate should be well-versed in Haskell as well as HTML and jQuery. The project will be personally mentored by me, Heinrich Apfelmus, with regular meetings on Skype.