1 <sect1>Release notes for version~4.00---10/98
2 <label id="release-4-00">
5 <sect2>Language matters
10 <item> Universal and existential quantification: see Section <ref
11 name="Explicit universal quantification"
12 id="universal-quantification"> and Section <ref name="Existentially
13 quantified data constructors" id="existential-quantification">
16 Universal quantification was in in GHC 2.10 and later, but the
17 syntax has changed: it's now @forall a. ...@ instead of @All a => ...@.
19 <item> Multi-paramter type classes. We have relaxed some of the rules
20 since GHC 3.00. In particular
23 <tag>@-fallow-overlapping-instances@</tag>
24 allows overlapping instances
25 <tag>@-fallow-undecidable-instances@</tag>
26 allows you to write instance contexts that constrain non-type-variables
29 Full details in Section <ref name="Multi-parameter type classes"
30 id="multi-param-type-classes">.
36 Documentation in <url name="GHC/Hugs Extension Libraries"
45 <tag>@Exceptions@</tag>
47 The library @Exception@ in @-syslib exts@ provide an interface for
48 exception handling. Calls to @error@, pattern matching failures and a
49 bunch of other exception can be caught.
53 <sect2>Compiler internals
56 The intermediate language used by GHC has had a radical overhaul.
57 The new Core language (coreSyn/CoreSyn.lhs) is much smaller and
58 more uniform. The main transformation engine (the "simplifier")
59 has been totally rewritten. The compiler is several thousand lines
60 shorter as a result. It's also very much easier to understand
61 and modify. (It's true. Honest!)
64 <sect2>Run time system
67 There is a completely new runtime system, aimed at integration with
68 Hugs. Tons of cruft removed. Some changes to code generation; things
69 typically run a bit faster as a result.
71 An overview of the new RTS is available: <url name="The New GHC/Hugs
72 Runtime System" url="http://www.dcs.gla.ac.uk/~simonm/rts.ps">.
74 <sect2>Storage Manager/Garbage Collector
77 The new storage manager features a dynamically resizing heap, so you
78 won't need those pesky @-H@ options anymore. In fact, the @-H@ option
79 is now ignored for compatibility with older versions.
81 Stacks are now also expandable, and the @-K@ option now specifies a
82 <em/maximum/ heap size. The default is (a perhaps conservative) @1M@.
84 The garbage collector now collects CAFs, so there's no more space
85 leaks associated with these. If you think you have a CAF-related
86 space leak, we'd like to hear about it.
88 The storage manager current only has a two-space garbage collector,
89 which will be slower than 3.02's generational collector when the
90 amount of live data is large. A new generational collector is high on
93 For the other new tweakables, see Section <ref name="RTS options to
94 control the garbage-collector" id="rts-options-gc">.
99 There is a new profiler based on <em/Cost Centre Stacks/. This is an
100 extension of the previous cost centre scheme, whereby the profilier
101 stores information about the call-graph of the program and attributes
102 costs to nodes of this graph.
104 For a quick demo, try compiling a program with @-prof -auto-all@, then
105 run it with @+RTS -p@ and see what comes out (in the @<prog>.prof@
108 The feature is still experimental, and the call graph may not be
109 exactly what you were expecting. Also, we only have time/allocation
110 profiling at the moment; heap profiling will follow shortly.
117 <item> Concurrent Haskell is now the default. No need to
118 compile/download special libraries. The context switch interval isn't
119 tweakable any more; threads just yield after allocating a fixed amount
120 of heap (currently 4k). If you want a quicker context switch, that
121 won't be possible: this decision was made for efficiency reasons (it
122 reduces the penalty for runnning threaded code to almost zero). We
123 might allow the context switch interval to be increased in the future;
124 but also context switches are pretty fast (faster than before).
126 <item> @forkIO@ now returns a @ThreadId@, and there's a new operation
127 @killThread@ which will terminate an existing thread. See Section
128 <ref name="The Concurrent interface" id="concurrent-interface"> for
131 <item> You need @-syslib concurrent@ to get the @Concurrent@ library.
133 <item> The rewritten IO library from 3.03 has been ported to 4.00.
135 <item> New constructs: @foriegn import@ and @foreign export@ for
138 <item> Supported architectures: all the development has been done on
139 x86(mainly FreeBSD/Linux) so this is the most stable environment.
140 Sparc (Solaris) and x86/Win32 (cygwin32) have also been mildly tested, and
141 an Alpha port is in the works. Everything else will need a little
142 porting effort; we don't have machines here, so any help would be
145 <item> Code is faster and smaller, but programs might run slower due
146 to the garbage collector (see "Storage Manager" above). Increasing
147 the minimum allocation area with the @-A@ RTS option can claw back
150 <item> We now use GMP 2.02, and attempt to use an already-installed
151 copy if available. If you have GMP on your system but the configure
152 script doesn't detect it, we'd like to know.
154 <item> @seq@ works better than in 3.xx - you can now @seq@ functions
155 without crashing the program.
157 <item> The @Eval@ class has been removed (i.e. every type is assumed
158 to be in class @Eval@). This change has been made in anticipation of
161 <item> The native code generator has had very little testing (it's not used
162 on x86 yet), so Sparcs may have some trouble with it. Try -fvia-C if
163 strange errors occur.
165 <item> The compiler is slightly faster, but sometimes needs more heap.
166 If you have an example where this is the case, please let us know.