[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / docs / users_guide / 4-00-notes.vsgml
1 <sect1>Release notes for version~4.00---10/98
2 <label id="release-4-00">
3 <p>
4
5 <sect2>Language matters
6 <p>
7
8 <itemize>
9
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">
14 respectively.
15
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 => ...@.
18
19 <item> Multi-paramter type classes.  We have relaxed some of the rules
20   since GHC 3.00.  In particular
21
22 <descrip>
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
27 </descrip>
28
29 Full details in Section <ref name="Multi-parameter type classes"
30 id="multi-param-type-classes">.
31 </itemize>
32
33 <sect2>New Libraries
34 <p>
35
36 Documentation in <url name="GHC/Hugs Extension Libraries"
37 url="libs.html">.
38
39 <descrip>
40
41 <tag>@Dynamic@</tag>
42
43 Dynamic types.  
44
45 <tag>@Exceptions@</tag>
46
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.
50
51 </descrip>
52
53 <sect2>Compiler internals
54 <p>
55
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!)
62
63
64 <sect2>Run time system
65 <p>
66
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.
70
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">.
73
74 <sect2>Storage Manager/Garbage Collector
75 <p>
76
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.
80
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@.
83
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.
87
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
91 our priority list.
92
93 For the other new tweakables, see Section <ref name="RTS options to
94 control the garbage-collector" id="rts-options-gc">.
95
96 <sect2>Profiling
97 <p>
98
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.
103
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@
106 file).
107
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.
111
112 <sect2>Miscellaneous
113 <p>
114
115 <itemize>
116
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).
125
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
129 more details.
130
131 <item> You need @-syslib concurrent@ to get the @Concurrent@ library.
132
133 <item> The rewritten IO library from 3.03 has been ported to 4.00.
134
135 <item> New constructs: @foriegn import@ and @foreign export@ for
136 H/Direct.
137
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
143 greatly appreciated.
144
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
148 some of this speed.
149
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.
153
154 <item> @seq@ works better than in 3.xx - you can now @seq@ functions
155 without crashing the program.
156
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
159 Haskell 98.
160
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.
164
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.
167
168 </itemize>