[Haskell-cafe] Why Haskell?

Neil Mitchell ndmitchell at gmail.com
Sat Jul 22 17:51:08 EDT 2006


Hi,

> 1) Lack of debugging support.
See Hat http://www.haskell.org/hat - it might give you the debugging
stuff you want, provided you have stuck mainly to Haskell 98.

> 2) Recompiling binaries (necessary in order to link in foreign object
> code into GHCi) is slow using GHC.  Moreover I have to restart GHCi if I
> want to reload a changed DLL (unless there is a way to unload a DLL in
> GHCi).  It also requires jumping around between several console windows
> to get the job done.  (I'm not using an IDE does one exist?)
Have you seen Hugs/WinHugs? Its a lot faster to load files, by a
massive factor (one particular project I use is 5 seconds in Hugs vs 8
minutes in GHC). http://haskell.org/hugs - its also much slower at
runtime :)

> 3) Lack of automatic type coercion for closely related types.  In
> particular I have to use CInt and CDouble to go into and out of C.
You can probably play with type classes and get something doing this
automatically in some way, for some cases.

> 4) GHCi is really not as useful as I'd hoped.  You can not just cut and
> paste Haskell code from a text file and run it in the interpreter.
> There is also this context issue concerning what modules are actually in
> scope.  So although in Haskell once I import a module, all of its
> functions are in scope, in GHCi, if I load this module only the exported
> functions from that module are in scope.
It does seem to work when I do it, not quite sure, but if you give an
exact example of what doesn't work then perhaps people can look at it.
Also :m+ is useful, in addition to :l.

> Thus I have been using GHCi primarily as a syntax checker for Haskell
> constructs.
If that is all you are using GHCi for, and you aren't using any GHC
specific features, Hugs will be much much quicker, and if you use
WinHugs you'll get auto-reload and hyperlinks to error locations as
well.

> Thus I begin to wonder why I'm using Haskell.
If you are writing most of your code in C, then maybe you should be
using C instead of Haskell - interfacing between two languages always
has a cost.

Of course, you probably don't realise how much advantage you are
getting from Haskell. How many lines of Haskell code do you have in
this project? Think how painful that would be to code in C.

Thanks

Neil


More information about the Haskell-Cafe mailing list