York release of nhc13


Why use the nhc13 Haskell compiler?

Because you have a small machine.
nhc13 is designed for space-efficiency. Compile the same program under either ghc or hbc, and compare it with that produced by nhc13. Generally, nhc13 produces smaller executables, and runtime space usage is also much smaller. (With the York release of nhc13 you can also compress your heap data.) Expect to pay a speed penalty though - programs produced by nhc13 run slower than with ghc or hbc (although they are still faster than Hugs).
Because your programs have strange space behaviour.
nhc13 has the most advanced heap profiler in the Haskell world, allowing you to observe in very fine detail exactly what is happening to the heap.
Because your program crashes, or produces the wrong output.
The York release of nhc13 has advanced tracing facilities, based on a reduction trail browser. 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.

What about Haskell 1.4?

The Haskell 1.4 language report is both unstable and broken. We are waiting for the forthcoming Standard Haskell definition which will fix the mistakes and give a solid reference. Until then, we believe 1.3 is a better platform for realistic use of the language.

Why do the York and Chalmers releases of nhc13 differ?

Although Niklas is continuing to refine nhc13 at Chalmers, (keeping it up-to-date with current language developments, fixing bugs and so on), his time available for working on nhc13 is limited, so he prefers to spend it on exciting new development rather than on the tedious business of producing distribution packages.

The York release represents an additional development effort, mainly focussed on adding new compiler features and libraries. It incorporates Niklas's latest work, and will continue to do so. Hence, the York release is more up-to-date than the publically-available Chalmers release (which essentially froze in October 1996).

What is new in the York release?

Features added in the York release of nhc13 which were not previously available include: binary data representations; the GreenCard foreign language interface; computational traces; time profiling; and portable cross-compilation.

  • nhc13 can generate code for tracing (debugging) your computations. A tutorial describing how to use the tracer is now available. See also reference [2].
  • Binary data representations. In summary, an additional library module provides bit-stream operations and a new Binary class for which the compiler supports "deriving" clauses. Fuller details can be found in [1] and in this documentation.
  • GreenCard is a preprocessor for interfacing to C libraries. It was developed for ghc and hugs, and is now available for nhc13. See this page for details.
  • There are now facilities for time-profiling your programs.
  • Finally, nhc13 can be used as a cross-compiler for other machines, including embedded systems. It can generate bytecode in a portable ANSI-C format, for either big- or little-endian machines.

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, Colin Runciman and Jan Sparud, Proceedings of the International Workshop on Implementation of Functional Languages, Southampton, Springer LNCS 1467, Sept 1997.


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

1998.11.05
York Functional Programming Group
Malcolm.Wallace@cs.york.ac.uk