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.

I have a detailed plan of how to get to a running prototype as soon as possible. Sure, it will be missing a lot of features, but the goal is to make something that works and can be widely used. The project succeeds if we manage to replace the Show class with something more awesome and people (in particular myself) will say “It may not supplant GHCi completely yet, but I’m going to use it anyway”. The focus is on modularity and documentation, so that the result, however complete it may be, can be easily integrated into the Haskell ecosystem (Haskell platform?) and expanded by the community. It goes without saying that the code will be put on github and on hackage.

Comments

Some HTML formatting is allowed.