What happened to all the Haskell compilers?

I recently found out about MicroHs, a Haskell compiler using combinators to get very small executables. It is, as far as I know, the only Haskell compiler besides GHC that is being actively developed/maintained. So I wonder, what happened to all the other Haskell compilers? I found the paper A History of Haskell: Being Lazy With Class from 2007, which, among other things, talks about the different Haskell implementations. There’s also a page on the Haskell Wiki about Haskell implementations. Since all of them, except GHC and MicroHs, are kind of dead, I’m interested in why they died and what made them special. Here’s what I gathered so far:

  • hbc was the first Haskell compiler, written in Lazy ML, by Lennart Augustsson (who is also the author of MicroHs). Being written in Lazy ML is likely why it died.
  • Hugs is a Haskell interpreter and seems to have been quite popular.
  • nhc98 was supposed to be space-efficient. It only works on 32 bit platforms.
  • Yale Haskell compiled to Common Lisp. It was abandoned in 1995 due to performance issues & lack of funding.
  • UHC (Utrecht Haskell Compiler) had JVM and JS backends.
  • jhc did whole-program analysis to produce efficient programs. Also works as a cross compiler.
  • yhc (York Haskell Compiler) was a fork of nhc. I found a blog post “Yhc is dead”. It seems the main reason for its death was that too many libraries rely on GHC.
  • LHC (LLVM Haskell Compiler) compiled to LLVM. Probably succeeded by GHCs LLVM backend?
7 Likes

Helium is another kind of maintained Haskell compiler.

UHC was mainly maintained by Atze Dijkstra who got a job at Standard Chartered (building their Mu compiler, which is for a dialect of Haskell). I think he wants to pick it up again after he retires.

2 Likes

What happened to all the [other] Haskell compilers?

  • GHC;

  • x86-64;

  • Haskell 2010.


GHC

As you’ve already discovered, the pre-H.2010 Haskell compilers were abandoned because GHC’s performance kept improving. Hugs was eventually abandoned because of ghci (though its compact size and portable codebase still sees some interest, including from MicroHs!)

After 2010, I believe those (remaining) compilers were abandoned either because of dwindling interest (yhc) or efforts (research or otherwise) being redirected to GHC. The latter continues to happen - I dimly recall reading about Standard Chartered’s decision to replace their “in-house” Mu implementation with one based on GHC.

Too many libraries relying on GHC is also a problem for MicroHs:

(and any future alternative Haskell implementation).


x86-64

Being an interpreter, Hugs was probably the first to support it, and hbc already supported the Sparc 64-bit architecture. Using the 32-bit compatibility mode of x86-64, eventually nhc was ported over as well.

But FFI support for x86-64 in Hugs is incomplete - from mkThunk() in src/builtin.c:

/* line 2056 */
#if i386_HOST_ARCH

/* line 2073 */
#elif powerpc_HOST_ARCH && defined(__GNUC__)

/* line 2122 */
#elif sparc_HOST_ARCH && defined(__GNUC__)

/* line 2181 */
#else
    ERRMSG(0) "Foreign import wrapper is not supported on this architecture"
    EEND;
#endif

But probably the main reason why no other Haskell implementation was ported across was the work involved to do so - despite the support it had, even GHC’s port required sustained effort to work “as expected” (i.e. faster than x86).


Haskell 2010

None of the pre-H.2010 implementations “fully” migrated to 2010 in time - having already mentioned the difficulties in Hugs, it did arrive in nhc (but I believe that was due to the efforts of the yhc developers, for bootstrapping purposes). There was no great interest in upgrading the remaining pre-H.2010 Haskell implementations - by then most people had (perhaps reluctantly) “settled for” GHC.


So it would appear that the process of convergence started in 1987 has worked too well:

  • with Haskell superseding the various (and mostly “single-site” ) non-strict languages that existed back then;

  • and GHC superseding the other implementations of Haskell (and those of other functional languages such as Mu*).

…now both Curry and Prolog have more implementations than Haskell.

5 Likes

Note that Hugs was based on Gofer – which wasn’t quite Haskell, but was a development of ML Miranda in a Haskellish direction.

And not quite true to say Hugs is dead. See posts on the Hugs-users mailing list, as well as @atravers’ links.

(I’d write more, but sorry, I’m travelling at the moment, so limited access.)

1 Like

I made an archive of Haskell implementations here FWIW Haskell Implementations Archive · GitHub

6 Likes

It takes substantial effort and knowledge to write a compiler, especially if nobody is supporting it’s development.