Release 1.08 of nhc98


Why use the nhc98 Haskell compiler?

Because it is easy to install.
Some people find ghc and hbc difficult to install on their machine. nhc98 is about as easy to setup as Hugs, and it is as portable too.
Because you have a small machine.
nhc98 is designed for space-efficiency. Compile the same program under either ghc or hbc, and compare it with that produced by nhc98. Generally, nhc98 produces much smaller executables, and runtime space usage is also very much smaller. (With the nhc98 Binary library you can compress your heap data in addition to the normal savings.) Expect to pay a speed penalty though - programs produced by nhc98 run slower than with ghc or hbc (although they are still rather faster than Hugs).
Because you're a software developer.
nhc98 comes with comprehensive tool support - hmake, hi, greencard, heap profiling, and two debuggers. Are you fed up waiting for ghc to compile your programs? nhc98 can be pretty quick at compiling, even though it is not as fast as hbc. For development work, it can also provide a useful check that you are sticking to the Haskell 98 standard and avoiding compiler-specific extensions.
Because your programs have strange space behaviour.
nhc98 has the most advanced heap profiler in the Haskell world [4], allowing you to observe in very fine detail exactly what is happening to the heap. Profile types include producer, construction, retainer, biography, and lifetime - and any combination thereof.
Because your program crashes, or produces the wrong output.
nhc98 has two sets of debugging facilities. First, Andy Gill's HOOD library together with his XML-based debugging browser. Second, York's advanced Hat tracing system based on redex trails [2,3], also with a graphical browser. In Hat-trail, browsing proceeds backwards from the error message or suspicious output value, observing and exploring the reduction history of parts of the computation. By answering the question "What function application caused the evaluation of this expression?" at each stage, it is possible to narrow down program bugs quickly. (Hat is still part of ongoing research, and will continue to be developed for some time.)

What language extensions does nhc98 support?

Extensions of the Haskell'98 language available in nhc98 include:

  • Binary data representations. In summary, an additional library module provides bit-stream operations and a new Binary class for which the compiler fully supports "deriving" clauses. Fuller details can be found in [1] and in this documentation.
  • The new common primitive FFI.
  • The IOExtras library, containing IORefs, IOArrays, trace, unsafePerformIO, etc.
  • Andy Gill's Observe.lhs library, used for HOOD debugging.
  • Local forall quantification on datatypes.
  • Extended module namespaces, of the form Long.Hierarchical.Module.Name.

References

[1] The Bits Between The Lambdas - Binary Data in a Lazy Functional Language, Malcolm Wallace and Colin Runciman, Proceedings of the International Symposium on Memory Management, Vancouver, Oct 1998. [FTP site]

[2] Tracing Large Functional Computations Using Partial Redex Trails, Jan Sparud and Colin Runciman, Proc 9th IFL, St Andrews, Springer LNCS 1467, Sept 1997. [FTP site]

[3] Tracing Lazy Functional Computations Using Redex Trails, Jan Sparud and Colin Runciman, Proc 9th PLILP, Southampton, Springer LNCS 1292, Sept 1997. [FTP site]

[4] Heap Profiling for Space Efficiency, Colin Runciman and Niklas Röjemo, 2nd Intl School on Advanced Functional Programming, pp.159-183, Springer LNCS 1129, Olympia WA, Aug 1996. [FTP site]


The latest updates to these pages are available on the WWW from http://www.cs.york.ac.uk/fp/nhc98/

2001.04.25
York Functional Programming Group