[Haskell-cafe] Compilers

Daniel Fischer daniel.is.fischer at web.de
Sat Nov 29 17:41:03 EST 2008

Am Samstag, 29. November 2008 11:41 schrieb John Meacham:
> On Fri, Nov 28, 2008 at 07:41:42PM -0800, Don Stewart wrote:
> > john:
> > > On Wed, Nov 26, 2008 at 07:20:12PM -0800, Jason Dagit wrote:
> > > > I spoke with the author of the fork a bit in IRC around the time it
> > > > happened and my understanding is that:
> > > > 1) John sternly objects to using cabal as the build system for JHC
> > >
> > > This is a fairly silly reason to fork a project, especially jhc, for a
> > > number of reasons.
> >
> > One of the reasons though, for the branching, is that the potential
> > developers, who all have Haskell toolchains, couldn't do:
> >
> >     $ cabal install jhc
> >
> > Then now can, but have to write 'lhc' instead of 'jhc'.
> >
> > We've probably just increased the jhc "alpha user" base 10 fold. Hooray!

Yes, that's very nice to be able to just type
$ cabal update
$ cabal install whatever
and cabal automatically takes care of dependencies (unfortunately only Haskell 
dependencies, but hey, can't expect real magic), while the configure && make 
build system requires me to do it all myself (which becomes a real PITA when 
there are many dependencies not yet installed).

> Also, I am not so sure who these people are who are willing to type 10
> characters to try out jhc, but not a dozen more.

I doubt a few dozen keystrokes make a difference to those who are willing to 
try out jhc, but chasing dependencies could make a difference. Fortunately 
jhc hasn't many, so I was ready to try both methods.

1. cabal install lhc
20 minutes later I have an lhc executable installed (and the graphviz 
package), great, can't be any simpler.
$ lhc -o lhcHeap heapMain
lhc: user error (LibraryMap: Library base not found!)


2. grab jhc, configure && make
I need
ghc >= 6.8.2, yes, 6.8.3
DrIFT, yes, 2.2.3
binary, yes
zlib, yes

Great, nothing I don't already have, so download the source tarball, unpack 
./configure --prefix=$HOME
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
... more configure output ...
checking for drift-ghc... no
configure: error:  DrIFT not found get it from 

dafis at linux:~/jhc/jhc-0.5.20080307> which DrIFT
dafis at linux:~/jhc/jhc-0.5.20080307> DrIFT --version
Version DrIFT-2.2.3

Okay, ./configure --help and searching through the configure script (which I 
completely don't know the syntax of) lead me to try 
./configure --prefix=$HOME DRIFTGHC=/home/dafis/.cabal/bin/DrIFT
which successsfully completes the configure step, but shouldn't configure find 
executables in the path?
Now make. Lots of warnings, but doesn't fail.
make install, okay, ready to go.

helloWorld works, good, but dumps thousands of lines of output I don't want. 
How do I tell jhc to shut up, and why isn't that the default? 
Now something a bit harder, make me a couple of primes. First problem:
import System.Environment (getArgs)

Error: Module not found: System.Environment

Okay, different organisation of base package, mildly annoying, use
import System (getArgs). Now
... myriads of lines of output ...
jhc: user error (Grin.FromE - Unknown primitive: ("eqRef__",[EVar (6666::ELit 
(Data.IORef.Ref__ (ELit (Jhc at .Box.*::ESort *))::ESort #)),EVar (6670::ELit 
(Data.IORef.Ref__ (ELit (Jhc at .Box.*::ESort *))::ESort #))]))

And I get the same error for every nontrivial programme I tried to compile, 
but not for a couple of trivial programmes.

So I spent a few of hours to litter my hard disk with a completely useless 
broken lhc and a basically useless broken jhc :(

the cabal package is much easier to install, but in this case the result of 
configure && make is marginally more useful.
However, neither produced a working compiler, so no cake.
Both systems suck when they fail.


More information about the Haskell-Cafe mailing list