[Haskell-cafe] Why Not Haskell?

Brian Hulley brianh at metamilk.com
Fri Aug 4 14:34:34 EDT 2006

Hans van Thiel wrote:
> Hello All,
> I'm wondering why I can't find any commercial Haskell applications on
> the Internet. Is there any reason for this?

I'm actually working on a Haskell program which I hope to release as a 
commercial application. The biggest problem I'm encountering is the lack of 
a really solid collections library that's as well thought out as C++ STL 
because although there are several competing collections libraries, each 
allowing fast development of powerful code, they all have various faults and 
limitations and I hate the idea of my code resting on half-baked 
foundations. I'm also a rabid perfectionist (and extremely fussy with regard 
to code aesthetics) when it comes to these kind of things so perhaps it's my 

Perhaps it's also because Haskell raises your expectations regarding what a 
good program should be like, so it's easy to get lost in abstraction. Eg 
last week all I needed was an equivalent of the C++ std::vector but I've 
wasted the whole of this week trying to create the perfect factoring of 
collection classes to try and avoid having concrete types everywhere and to 
be a foundation for all the uses of collection types in my program, and now 
I'm totally lost in a miasma of undecidable instances and difficult 

> I can think of the following possibilities only:
> 1) Haskell is too slow for practical use, but the benchmarks I found
> appear to contradict this.

I think it's fast enough. There's also a very good foreign function 
interface if you need to get the full speed of C for some inner loop. And a 
bonus is that as more and more people use it, it's likely that more effort 
will be done to make it faster.

> 2) Input and output are not good enough, in particular for graphical
> user interfacing and/or data base interaction. But it seems there are
> several user interfaces and SQL and other data base interfaces for
> Haskell, even though the tutorials don't seem to cover this.

You just need to check the licences for the various bindings and also the 
licences for the C libs they're bound to so you don't end up with a GPL 
infested program. WxWidgets uses LGPL with the linking exception so it 
should be 100% safe and easy to use 
(http://wxhaskell.sourceforge.net/license.html ). Gtk2Hs uses the LGPL 
according to http://haskell.org/gtk2hs/overview/ but it does not appear to 
admit the linking exception though this is not insurmountable - it just 
means you need to supply an object file of your code along with your exe 
(and if you use Unix there's no trouble at all because the lib is linked 
dynamically iirc)

> 3) Haskell is not scaleable for commercial use. This looks unlikely to
> me, but could this be a factor?

It can be difficult to know how to organise a large program in Haskell if 
you're used to OOP but I don't think there are any limits on scalability per 
se - GHC is itself an example of a very large Haskell program that's widely 
used on many platforms.

> 4) Haskell is open source and licensing restrictions forbid commercial
> applications. I haven't seen any such restrictions, but is this a
> problem for the standard modules?

You can discover the licensing situation by downloading the GHC source (or 
source for whatever distro you're using) and looking in the directories for 
each package. For example the base package uses a BSD-style licence and 
HaXml uses LGPL with the exception to allow static linking.
It would be good if this info was also on the wiki somewhere but if it is I 
can't find it, or if there was a tool to identify or gather together the 
various licenses and create a composite license (eg including the list of 
the names of all contributors who want to be mentioned) to distribute with 
your app (a free lawyer implemented in Haskell together with its own 
self-generated license!!!).

If you're going to release your app on Windows using GHC you'll need to 
prepare an object file to distribute along with your exe to satisfy the 
annoying LGPL linking restriction imposed by the GMP library that's 
currently part of the statically linked runtime, but this shouldn't be an 
obstacle once you've written the appropriate batch file to generate it.

(There's a thread on the ghc users mailing list indicating that GMP might be 
removed from GHC at some point which would make life even easier - see 
http://www.haskell.org/pipermail/glasgow-haskell-users/2006-August/010665.html )


> Why hasn't Haskell made it into the business world (yet), after being
> available for 15 years, or is this the wrong question?

This might just be because computers were too slow in the past to run 
programs written in such high level languages as Haskell, so everyone had to 
use low-level languages like C and C++ (people even now still spend 
sleepless nights debating whether or not to use a virtual function in a C++ 
class because of the extra indirection it requires).

Also, the bottom line imho is that Haskell is a difficult language to 
understand, and this is compounded by the apparent cleverness of unreadable 
code like:

     c = (.) . (.)

when a normal person would just write:

     c f g a b = f (g a b)

Anyway good luck! I think anyone who *doesn't* take advantage of very high 
level languages like Haskell is just shooting themselves in the foot... :-)

Regards, Brian.
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.


More information about the Haskell-Cafe mailing list