Why is GHC so difficult to compile?

I'm trying to compile a recent version of GHC (say, 7.4 or 7.6) on Solaris, compiling using a 6.12.1 binary. However, I've noticed GHC requires an exact GCC version of 4.1.2 to compile itself, as well as many other requirements.

Why are the prerequisites for building GHC so strict? Haskell is so powerful I can't imagine much that couldn't be written in pure Haskell, so why does GHC need a C-compiler to compile itself? Is there a version of GHC I can compile with just a Haskell compiler? Note that I don't need it to generate highly optimised code, even just getting GHCi working will be fine.


The Haskell compiler itself of GHC is written in Haskell, so you can (and must) compile it using a Haskell compiler. In fact I believe that you actually need GHC itself to compile it, but as you have tried, you probably found out that the bootstrapping process does all of that for you.

However, there is also a run-time system (RTS), which is written in C. To compile it you need a C compiler.

链接地址: http://www.djcxy.com/p/33290.html

上一篇: 巨大的Windows可执行文件,用于Haskell程序

下一篇: 为什么GHC很难编译?