Why Exotic Languages Are Not Mainstream

Tuesday, August 9, 2006

Introduction

Haskell is an excellent programming language. It has features that allow for a tremendous productivity boost. Type inference figures out and lets you examine types of every piece of code that you write so you don't have to baby sit the compiler, yet you get the benefits of static typing. Functions are first class objects so you can build abstractions without writing useless glue code. The language is elegant and has plenty of syntactic sugar that makes it a pleasure to work with. It even has libraries for things you may want to do in a real world project. So why wouldn't you want to pick Haskell for your projects?

A few days ago I was kicking around a few ideas and I had no reason not to use Haskell to build a prototype. Besides, it was time for me to start eating my own dog food. So I started shopping for a Haskell compiler. GHC seemed like a good bet - a fast, stable, cross platform, real compiler (not a flimsy interpreter) that would let me create production quality code. And it's free. After downloading it I did something every self respecting Windows programmer would do - I wrote a program that tried to open a window. That didn't work. Well, it did, but it took five (yes, you read that right, five) minutes for the window to open. So I hit the web and found a bug report for this issue. No solution. I sent an email to the GHC support group and got the following reply1:

Unfortunately this code is currently broken with GHC on windows. No one has fixed it because the code is low level, ugly and few people understand it.

That's no big deal. I figured I'll just download another compiler. Hugs seemed like a good bet. Ok, so it's just an interpreter, but these days who cares? I downloaded it and tried to run the same program through Hugs. Whoops, an error. Some DLL missing. I hit the web, and found the following:

The libraries that ship with WinHugs May 2006 are a fresh build, those with the old version are from a really old WinHugs release, hence the different contents. [...] For the moment you should be able to paper over the problem by copying the old Win32 directory into the packages directory, replacing the new one.

Hmm, frustrating, but again, no big deal. I downloaded the older version and overwrote the directory. The graphics library finally worked! Now all I needed was an IDE and I'd be well on my way to building my application in Haskell. I searched the web and realized that the number of choices is very small. People seemed to suggest Visual Haskell the most, so I gave it a try. The environment was actually really nice, except one issue: I couldn't evaluate expressions from the IDE. This reduced me back to the old style change-recompile-run development cycle and I didn't want that. Evaluating expressions through the command line involves constantly switching between evaluation contexts manually, so I thought I may be missing something since it's such an essential feature. So I shot an email to the support group for Visual Haskell and here's the reply:

Unfortunately this isn't supported feature. It is highly desirable but it requires lots of work. I am planning a new VSHaskell release but the only new thing that it will have is a support for VStudio 2005. VSHaskell is a noncommercial product without any funding and I work on it only in my free time.

Bummer.

What's Next?

Is Haskell a great deal of fun to play with? Absolutely. Does it stretch your mind and make you a better programmer even if you never actually use it at work? No doubt about it. Would I bet my business (and my family's well being) on it? Looks like the jury is still out.

Feedback

After publishing this article I received e-mails from people closely related to WinHugs and GHC development teams. They assured me that the issues I mentioned are being worked on and are taken seriously. I'd like to stress that despite some shortcomings Haskell is an excellent platform for solving many real world problems and it will only improve with time. Additionally it has benefits that mainstream languages can't afford to have: Haskell designers are just an e-mail away. I strongly encourage everyone to look into this wonderful language. This article is not meant to be a deterrent. On the contrary, it's a call to fix superficial issues that act as barriers for adoption.

Updated: 08/18/2006

Comments?

If you have any questions, comments, or suggestions, please drop a note at coffeemug@gmail.com. I'll be glad to hear your feedback.

1I didn't ask for permission to post the reply on this page because the question was asked on a public mailing list. You will probably be able to find the conversation in the web archives of GHC support list.