[project @ 2003-03-25 17:22:27 by simonmar]
[ghc-hetmet.git] / ghc / docs / users_guide / 5-04-notes.sgml
1 <sect1 id="release-5-04">
2   <title>Release notes for version 5.04</title>
3
4   <sect2>
5     <title>User-visible compiler changes</title>
6     <itemizedlist>
7       <listitem>
8         <para>Full support for MacOS X, including fully optimized compilation, has been added. Only a native
9         code generator and support for <option>-split-objs</option> is still missing.
10         Everything else needs more testing, but should work.</para>
11       </listitem>
12       <listitem>
13         <para><literal>ghc-pkg</literal>: new options
14         <option>--auto-ghci-libs</option>,
15         <option>-u</option>/<option>--update-package</option>,
16         <option>--force</option>, and
17         <option>-i</option>/<option>--input-file</option>, and
18         suppport for expanding environment variables in package
19         descriptions.  See <xref linkend="packages">).</para>
20       </listitem>
21       <listitem>
22         <para>The latest version of the FFI spec is fully supported.
23         The syntax of FFI declarations has changed accordingly.  The
24         old syntax is still accepted for the time being, but will
25         elicit a warning from the compiler.</para>
26       </listitem>
27       <listitem>
28         <para>New option: <option>-F</option> specifies a user-defined
29         preprocessing phase (see <xref linkend="pre-processor">).</para>
30       </listitem>
31       <listitem>
32         <para>Major overhaul of the heap profiling subsystem, with new
33         facilities for retainer profiling and biographical profiling
34         (ala nhc98, albeit with a couple of omissions).  The syntax of
35         the runtime heap-profiling options has changed.  See <xref
36         linkend="prof-heap">.</para>
37       </listitem>
38       <listitem>
39         <para>The type system now supports full rank-N types
40         (previously only limited rank-2 types were supported).  See
41         <xref linkend="universal-quantification">.</para>
42       </listitem>
43       <listitem>
44         <para>Explicit kind annotations can now be given on any
45         binding occurrence of a type variable.  See <xref
46         linkend="sec-kinding">.</para>
47       </listitem>
48       <listitem>
49         <para>The handling of type synonyms has been rationalised.
50         See <xref linkend="type-synonyms">.</para>
51       </listitem>
52       <listitem>
53         <para>Fixes for several space leaks in the compiler itself
54         (these fixes were also merged into 5.02.3).</para>
55       </listitem>
56       <listitem>
57         <para>It is now possible to derive arbitrary classes for
58         newtypes.  See <xref linkend="newtype-deriving">.</para>
59       </listitem>
60       <listitem>
61         <para>Deadlock is now an exception, rather than a return
62         status from the scheduler.  See the module
63         <literal>Control.Exception</literal> in the library
64         documentation for more details.</para>
65       </listitem>
66       <listitem>
67         <para>The syntax and behaviour of <literal>RULE</literal>
68         pragmas has changed slightly.  See <xref
69         linkend="rewrite-rules">.</para>
70       </listitem>
71       <listitem>
72         <para>Interface files are now in a binary format to reduce
73         compilation times.  To view an interface file in plain text,
74         use the <option>--show-iface</option> flag.</para>
75       </listitem>
76       <listitem>
77         <para>A restriction on the form of class declarations has been
78         lifted.  In Haskell 98, it is illegal for class method types
79         to mention constraints on the class type variable.  eg.</para>
80
81 <programlisting>
82    class Seq s a where
83       elem     :: Eq a => a -> s a -> Bool
84 </programlisting>
85         
86         <para>This restriction has now been lifted in GHC.</para>
87       </listitem>
88       <listitem>
89         <para>Main threads can now receive the
90         <literal>BlockedOnDeadMVar</literal> exception in the same way
91         as other threads.</para>
92       </listitem>
93       <listitem>
94         <para>The <option>-fall-strict</option> flag never really
95         worked, and has been removed.</para>
96       </listitem>
97       <listitem>
98         <para>The syntax of <literal>.hi-boot</literal> files is now
99         much clearer and Haskell-like.  See <xref
100         linkend="mutual-recursion">.</para>
101       </listitem>
102       <listitem>
103         <para>There is a new flag <option>-fffi</option> which enables
104         FFI support without turning on the rest of the GHC
105         extensions.</para>
106       </listitem>
107       <listitem>
108         <para>The syntax for implicit parameter bindings has changed.
109         Previously the keyword <literal>with</literal> was used to
110         introduce implicit bindings, but now implicit bindings may be
111         introduced using <literal>let</literal> (see <xref
112         linkend="implicit-parameters">).  As a result of this,
113         <literal>with</literal> is no longer a keyword when
114         <option>-fglasgow-exts</option> is turned on.</para>
115         
116         <para>The option <literal>-fwith</literal> may be used to
117         restore the old behaviour.</para>
118       </listitem>
119       <listitem>
120         <para>Infix type constructors are now allowed, and must begin
121         with a colon (as with data constructors).  See <xref
122         linkend="infix-tycons">.</para>
123       </listitem>
124       <listitem>
125         <para>The <literal>do</literal>-notation syntax is now
126         rebindable in the same way as other built-in syntax.  See
127         <xref linkend="rebindable-syntax">.</para>
128       </listitem>
129       <listitem>
130         <para>Support for using &ldquo;frameworks&rdquo; on
131         Darwin/MacOS X has been added.  See the
132         <option>-framework</option> option in <xref
133         linkend="options-linker">, and the
134         <literal>framework_dirs</literal> field of a package spec in
135         <xref linkend="package-management">.</para>
136       </listitem>
137     </itemizedlist>
138   </sect2>
139   
140   <sect2>
141     <title>User-visible interpreter (GHCi) changes</title>
142     <itemizedlist>
143       <listitem>
144         <para>New commands: <literal>:browse</literal>, <literal>:set
145         args</literal>, <literal>:set prog</literal>, <literal>:show
146         binadings</literal>, and <literal>:show modules</literal> (see
147         <xref linkend="ghci-commands">).</para>
148       </listitem>
149       <listitem>
150         <para>There is a much more flexible mechanism for manipulating
151         the scope for expressions typed at the prompt.  For example,
152         one can now have both the <literal>Prelude</literal> and the
153         exports of several compiled modules in scope at the same
154         time.  See <xref linkend="ghci-scope">.</para>
155       </listitem>
156       <listitem>
157         <para>GHCi now supports <literal>foreign import
158         "wrapper"</literal> FFI declarations.</para>
159       </listitem>
160     </itemizedlist>
161   </sect2>
162   
163   <sect2>
164     <title>User-visible library changes</title>
165     <itemizedlist>
166       <listitem>
167         <para>GHC is in the process of moving to a new hierarchical
168         set of libraries.  At the moment, we have two sets of
169         libraries, both described in accompanying documents:</para>
170         <itemizedlist>
171           <listitem>
172             <para>The &ldquo;new libraries&rdquo; which are
173             hierarchical and consist of the following packages:
174             <literal>base</literal>, <literal>haskell98</literal>,
175             <literal>haskell-src</literal>, and
176             <literal>network</literal>.  Broadly speaking,
177             <literal>base</literal> contains the
178             <literal>Prelude</literal>, standard libraries and most of
179             the contents of the old <literal>lang</literal>
180             package.  By default, the <literal>base</literal> and
181             <literal>haskell98</literal> packages are enabled.</para>
182           </listitem>
183
184           <listitem>
185             <para>The <literal>hslibs</literal>, most of which are now
186             deprecated.  Where possible, new code should be written to
187             use the new libraries instead. </para>
188
189             <para>The following libraries in <literal>hslibs</literal>
190             have not moved yet:</para>
191             <itemizedlist>
192               <listitem>
193                 <para>The packages <literal>win32</literal>,
194                 <literal>xlib</literal>, <literal>graphics</literal>,
195                 and <literal>posix</literal>.</para>
196               </listitem>
197               <listitem>
198                 <para>The Edison libraries in the
199                 <literal>data</literal> package.</para>
200               </listitem>
201               <listitem>
202                 <para>In the <literal>lang</literal> package, the
203                 modules <literal>TimeExts</literal>,
204                 <literal>DirectoryExts</literal>,
205                 <literal>SystemExts</literal>, and
206                 <literal>NumExts</literal>.</para>
207               </listitem>
208               <listitem>
209                 <para>The HaXml libraries in the
210                 <literal>text</literal> package.</para>
211               </listitem>
212               <listitem>
213                 <para>In the <literal>util</literal> package, the
214                 modules <literal>MD5</literal>,
215                 <literal>Select</literal>, <literal>Memo</literal>,
216                 <literal>Observe</literal>, and
217                 <literal>Readline</literal>.</para>
218               </listitem>
219             </itemizedlist>
220
221             <para>All other libraries from <literal>hslibs</literal>
222             either have equivalents in the new libraries (see the
223             <literal>hslibs</literal> docs for details), or were
224             already deprecated and hence were not moved into the new
225             hierarchy.</para>
226           </listitem>
227         </itemizedlist>
228       </listitem>
229       
230       <listitem>
231         <para>The <literal>Read</literal> class is now based on a
232         parsing combinator library which is vastly more efficient than
233         the previous one.  See the modules
234         <literal>Text.Read</literal>.
235         <literal>Text.ParserCombinators.ReadP</literal>, and
236         <literal>Text.ParserCombinators.ReadPrec</literal> in the
237         library documentation.</para>
238
239         <para>The code generated by the compiler for derived
240         <literal>Read</literal> instances should be much shorter than
241         before.</para>
242       </listitem>
243     </itemizedlist>
244   </sect2>
245
246   <sect2>
247     <title>New experimental features</title>
248     <itemizedlist>
249       <listitem>
250         <para>Linear implicit parameters.  See <xref
251         linkend="linear-implicit-parameters">.</para>
252       </listitem>
253       <listitem>
254         <para>The RTS has support for running in a multi-threaded
255         environment and making non-blocking (from Haskell's point of
256         view) calls to foreign C functions which would normally block.
257         To enable this behaviour, configure with the
258         <option>--enable-threaded-rts</option> option.</para>
259       </listitem>
260       <listitem>
261         <para>The compiler can now read in files containing Core
262         syntax (such as those produced by the
263         <option>-fext-core</option> option) and compile them. Input
264         files with the <literal>.hcr</literal> file extension are
265         assumed to contain Core syntax.</para>
266       </listitem>
267     </itemizedlist>
268   </sect2>
269
270   <sect2>
271     <title>Internal changes</title>
272     <itemizedlist>
273       <listitem>
274         <para>Happy 1.13 is now required to build GHC, because of the
275         change in names of certain libraries.</para>
276       </listitem>
277     </itemizedlist>
278   </sect2>
279
280 </sect1>
281
282 <!-- Emacs stuff:
283      ;;; Local Variables: ***
284      ;;; mode: sgml ***
285      ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter" "sect1") ***
286      ;;; End: ***
287  -->