506f92d7e08ae97ccf39f419a4b7c358144b7df5
[ghc-hetmet.git] / docs / users_guide / 6.14.1-notes.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <sect1 id="release-6-14-1">
3   <title>Release notes for version 6.14.1</title>
4
5   <para>
6     The significant changes to the various parts of the compiler are
7     listed in the following sections. There have also been numerous bug
8     fixes and performance improvements over the 6.12 branch.
9   </para>
10
11   <sect2>
12     <title>Highlights</title>
13     <itemizedlist>
14       <listitem>
15         <para>
16           Due to changes in the runtime system, version 2.0 or later
17           (preferably version 2.2 or later) of the
18           <literal>parallel</literal> library should be used, or
19           parallelism will be lost.
20         </para>
21       </listitem>
22
23       <listitem>
24         <para>
25           The full Haskell <literal>import</literal> syntax can now been
26           used to bring modules into scope in GHCi.
27         </para>
28       </listitem>
29     </itemizedlist>
30   </sect2>
31
32   <sect2>
33     <title>Language changes</title>
34     <itemizedlist>
35       <listitem>
36         <para>
37           GHC now understands the <literal>Haskell98</literal> and
38           <literal>Haskell2010</literal> languages.
39         </para>
40
41         <para>
42           These get processed before the language extension pragmas,
43           and define the default sets of extensions that are enabled.
44           If neither is specified, then the default is
45           <literal>Haskell2010</literal> plus the
46           <literal>MonoPatBinds</literal> extension.
47         </para>
48       </listitem>
49
50       <listitem>
51         <para>
52           GHC now supports the <literal>DoAndIfThenElse</literal>
53           extension, which is part of the Haskell 2010 standard.
54         </para>
55       </listitem>
56
57       <listitem>
58         <para>
59           Datatype contexts, such as the <literal>Eq a</literal> in
60         </para>
61 <programlisting>
62 data Eq a => Set a = NilSet | ConsSet a (Set a)
63 </programlisting>
64         <para>
65           are now treated as an extension
66           <literal>DatatypeContexts</literal> (on by default) by GHC.
67         </para>
68       </listitem>
69
70       <listitem>
71         <para>
72           GHC's support for unicode source has been improved, including
73           removing support for U+22EF for the <literal>..</literal>
74           symbol. See <xref linkend="unicode-syntax" /> for more details.
75         </para>
76       </listitem>
77
78       <listitem>
79         <para>
80           Pragmas are now reread after preprocessing. In particular,
81           this means that if a pragma is used to turn CPP on, then other
82           pragmas can be put in CPP conditionals.
83         </para>
84       </listitem>
85
86       <listitem>
87         <para>
88           The <literal>TypeOperators</literal> extension now allows
89           instance heads to use infix syntax.
90         </para>
91       </listitem>
92
93       <listitem>
94         <para>
95           The <literal>PackageImports</literal> extension now understands
96           <literal>this</literal> to mean the current package.
97         </para>
98       </listitem>
99
100       <listitem>
101         <para>
102           The <literal>INLINE</literal> and <literal>NOINLINE</literal>
103           pragmas can now take a <literal>CONLIKE</literal> modifier,
104           which indicates that the right hand side is cheap to compute,
105           and can thus be duplicated more freely.
106           See <xref linkend="conlike" /> for more details.
107         </para>
108       </listitem>
109
110       <listitem>
111         <para>
112           A <literal>ForceSpecConstr</literal> annotation on a type, e.g.
113         </para>
114 <programlisting>
115 import SpecConstr
116 {-# ANN type SPEC ForceSpecConstr #-}
117 </programlisting>
118         <para>
119           can be used to force GHC to fully specialise argument of that
120           type.
121         </para>
122       </listitem>
123
124       <listitem>
125         <para>
126           A <literal>NoSpecConstr</literal> annotation on a type, e.g.
127         </para>
128 <programlisting>
129 import SpecConstr
130 {-# ANN type T NoSpecConstr #-}
131 </programlisting>
132         <para>
133           can be used to prevent SpecConstr from specialising on
134           arguments of that type.
135         </para>
136       </listitem>
137
138       <listitem>
139         <para>
140           There is are two experimental new extensions
141           <literal>AlternativeLayoutRule</literal> and
142           <literal>AlternativeLayoutRuleTransitional</literal>,
143           which are for exploring alternative layout rules in Haskell'.
144           The details are subject to change, so we advise against using
145           them in real code for now.
146         </para>
147       </listitem>
148
149       <listitem>
150         <para>
151           The <literal>NewQualifiedOperators</literal> extension has
152           been deprecated, as it was rejected by the Haskell' committee.
153         </para>
154       </listitem>
155     </itemizedlist>
156   </sect2>
157
158   <sect2>
159     <title>Warnings</title>
160     <itemizedlist>
161       <listitem>
162         <para>
163           There is now a warning for missing import lists, controlled
164           by the new <literal>-fwarn-missing-import-lists</literal> flag.
165         </para>
166       </listitem>
167
168       <listitem>
169         <para>
170           GHC will now warn about <literal>SPECIALISE</literal> and
171           <literal>UNPACK</literal> pragmas that have no effect.
172         </para>
173       </listitem>
174     </itemizedlist>
175   </sect2>
176
177   <sect2>
178     <title>DLLs</title>
179     <itemizedlist>
180       <listitem>
181         <para>
182           Shared libraries are once again supported on Windows.
183         </para>
184       </listitem>
185
186       <listitem>
187         <para>
188           Shared libraries are now supported on OS X, both on x86 and on
189           PowerPC. The new <literal>-dylib-install-name</literal> GHC
190           flag is used to set the location of the dynamic library.
191           See <xref linkend="finding-shared-libs" /> for more details.
192         </para>
193       </listitem>
194     </itemizedlist>
195   </sect2>
196
197   <sect2>
198     <title>Runtime system</title>
199
200     <itemizedlist>
201       <listitem>
202         <para>
203           For security reasons, by default, the only RTS flag that
204           programs accept is <literal>+RTS --info</literal>. If you want
205           the full range of RTS flags then you need to link with the new
206           <literal>-rtsopts</literal> flag. See
207           <xref linkend="options-linker" /> for more details.
208         </para>
209       </listitem>
210
211       <listitem>
212         <para>
213           The RTS now exports a function <literal>setKeepCAFs</literal>
214           which is important when loading Haskell DLLs dynamically, as
215           a DLL may refer to CAFs that hae already been GCed.
216         </para>
217       </listitem>
218
219       <listitem>
220         <para>
221           The garbage collector no longer allows you to specify a number
222           of steps; there are now always 2. The <literal>-T</literal>
223           RTS flag has thus been removed.
224         </para>
225       </listitem>
226
227       <listitem>
228         <para>
229           A new RTS flag <literal>-H</literal> causes the RTS to use a
230           larger nursery, but without exceeding the amount of memory
231           that the application is already using. It makes some programs
232           go slower, but others go faster.
233         </para>
234       </listitem>
235
236       <listitem>
237         <para>
238           GHC now returns memory to the OS, if memory usage peaks and
239           then drops again. This is mainly useful for long running
240           processes which normally use very little memory, but
241           occasionally need a lot of memory for a short period of time.
242         </para>
243       </listitem>
244
245       <listitem>
246         <para>
247           On OS X, eventLog events are now available as DTrace probes.
248         </para>
249       </listitem>
250
251       <listitem>
252         <para>
253           The PAPI support has been improved. The new RTS flag
254           <literal>-a#0x40000000</literal> can be used to tell the RTS
255           to collect the native PAPI event <literal>0x40000000</literal>.
256         </para>
257       </listitem>
258     </itemizedlist>
259   </sect2>
260
261   <sect2>
262     <title>Compiler</title>
263     <itemizedlist>
264       <listitem>
265         <para>
266           GHC now defaults to <literal>--make</literal> mode, i.e. GHC
267           will chase dependencies for you automatically by default.
268         </para>
269       </listitem>
270
271       <listitem>
272         <para>
273           GHC now includes an LLVM code generator.
274         </para>
275         <para>
276           This includes a number of new flags:
277           a flag to tell GHC to use LLVM, <literal>-fllvm</literal>;
278           a flag to dump the LLVM input ,<literal>-ddump-llvm</literal>;
279           flags to keep the LLVM intermediate files,
280           <literal>-keep-llvm-file</literal> and
281           <literal>-keep-llvm-files</literal>;
282           flags to set the location and options for the LLVM assembler,
283           optimiser and compiler,
284           <literal>-pgmla</literal>,
285           <literal>-pgmlo</literal>,
286           <literal>-pgmlc</literal>,
287           <literal>-optla</literal>,
288           <literal>-optlo</literal> and
289           <literal>-optlc</literal>.
290         </para>
291       </listitem>
292
293       <listitem>
294         <para>
295           It is now possible to use <literal>-fno-code</literal> with
296           <literal>--make</literal>.
297         </para>
298       </listitem>
299
300       <listitem>
301         <para>
302           The new flag <literal>-dsuppress-coercions</literal> controls
303           whether GHC prints coercions in core dumps.
304         </para>
305       </listitem>
306
307       <listitem>
308         <para>
309           The inliner has been overhauled. The most significant
310           user-visible change is that only saturated functions are
311           inlined, e.g.
312         </para>
313 <programlisting>
314 (.) f g x = f (g x)
315 </programlisting>
316         <para>
317           would only be inlined if <literal>(.)</literal> is applied to 3
318           arguments, while
319         </para>
320 <programlisting>
321 (.) f g = \x -> f (g x)
322 </programlisting>
323         <para>
324           will be inlined if only applied to 2 arguments.
325         </para>
326       </listitem>
327
328       <listitem>
329         <para>
330           The <literal>-finline-if-enough-args</literal> flag is no
331           longer supported.
332         </para>
333       </listitem>
334
335       <listitem>
336         <para>
337           Column numbers in warnings and error messages now start at 1,
338           as is more standard, rather than 0.
339         </para>
340       </listitem>
341
342       <listitem>
343         <para>
344           GHCi now understands most linker scripts. In particular, this
345           means that GHCi is able to load the C pthread library.
346         </para>
347       </listitem>
348
349       <listitem>
350         <para>
351           The <literal>ghc --info</literal> output has been updated:
352         </para>
353         <para>
354           It now includes the
355           location of the global package database, in the
356           <literal>Global Package DB</literal> field.
357         </para>
358         <para>
359           It now includes the build, host and target platforms, in the
360           <literal>Build platform</literal>,
361           <literal>Host platform</literal> and
362           <literal>Target platform</literal> fields.
363         </para>
364         <para>
365           It now includes a <literal>Have llvm code generator</literal>
366           field.
367         </para>
368         <para>
369           The <literal>Win32 DLLs</literal> field has been removed.
370         </para>
371       </listitem>
372
373       <listitem>
374         <para>
375           The registerised via-C backend, and the
376           <literal>-fvia-C</literal>, have been deprecated. The poor
377           floating-point performance in the x86 native code generator
378           has now been fixed, so we don't believe there is still any
379           reason to use the via-C backend.
380         </para>
381       </listitem>
382
383       <listitem>
384         <para>
385           There is now a new flag <literal>--supported-extensions</literal>,
386           which currently behaves the same as
387           <literal>--supported-languages</literal>.
388         </para>
389       </listitem>
390
391       <listitem>
392         <para>
393           GHC progress output such as
394         </para>
395 <programlisting>
396 [ 1 of 5] Compiling Foo              ( Foo.hs, Foo.o )
397 </programlisting>
398         <para>
399           is now sent to stdout rather than stderr.
400         </para>
401       </listitem>
402
403       <listitem>
404         <para>
405           The new flag <literal>-fexpose-all-unfoldings</literal>
406           makes GHC put unfoldings for <emphasis>everything</emphasis>
407           in the interface file.
408         </para>
409       </listitem>
410
411       <listitem>
412         <para>
413           There are two new flags, <literal>-fno-specialise</literal>
414           and <literal>-fno-float-in</literal>, for disabling the
415           specialise and float-in passes.
416         </para>
417       </listitem>
418
419       <listitem>
420         <para>
421           The new flag <literal>-fstrictness-before=<replaceable>n</replaceable></literal> tells
422           GHC to run an additional strictness analysis pass
423           before simplifier phase <replaceable>n</replaceable>.
424         </para>
425       </listitem>
426
427       <listitem>
428         <para>
429           There is a new flag
430           <literal>-funfolding-dict-discount</literal>
431           for tweaking the optimiser's behaviour.
432         </para>
433       </listitem>
434
435       <listitem>
436         <para>
437           The <literal>-fspec-inline-join-points</literal> flag has been
438           removed.
439         </para>
440       </listitem>
441     </itemizedlist>
442   </sect2>
443
444   <sect2>
445     <title>GHCi</title>
446     <itemizedlist>
447       <listitem>
448         <para>
449           GHCi now supports full import syntax, e.g.
450         </para>
451 <programlisting>
452 Prelude> import Data.List as L
453 Prelude Data.List> L.length "foo"
454 3
455 </programlisting>
456       </listitem>
457
458       <listitem>
459         <para>
460           GHCi now understands the layout of multiline-commands, so
461           this now works:
462         </para>
463 <programlisting>
464 Prelude> :{
465 Prelude| let x = 1
466 Prelude|     y = 2 in x + y
467 Prelude| :}
468 3
469 </programlisting>
470       </listitem>
471     </itemizedlist>
472   </sect2>
473
474   <sect2>
475     <title>Template Haskell and Quasi-Quoters</title>
476     <itemizedlist>
477       <listitem>
478         <para>
479           It is now possible to quasi-quote patterns with
480           <literal>[p| ... |]</literal>.
481         </para>
482       </listitem>
483
484       <listitem>
485         <para>
486           It is no longer to use a <literal>$</literal> before the
487           name of a quasi-quoter, e.g. one can now say
488           <literal>[expr| ... |]</literal> rather than
489           <literal>[$expr| ... |]</literal>.
490         </para>
491       </listitem>
492
493       <listitem>
494         <para>
495           It is now possible to use a quasi-quoter for types, e.g.
496           <literal>f :: [$qq| ... |]</literal>
497         </para>
498       </listitem>
499
500       <listitem>
501         <para>
502           It is now possible to quasi-quote existentials and GADTs.
503         </para>
504       </listitem>
505     </itemizedlist>
506   </sect2>
507
508   <sect2>
509     <title>GHC API</title>
510     <itemizedlist>
511       <listitem>
512         <para>
513           There are now <literal>Data</literal> and
514           <literal>Typeable</literal> instances for the
515           HsSyn typed.
516         </para>
517       </listitem>
518
519       <listitem>
520         <para>
521           As language extensions are not applied until after the base
522           language (Haskell98, Haskell2010 or the default) has been
523           selected, it is now necessary to tell the GHC API the point
524           at which the extension flags should be processed. Normally
525           this is done by calling
526           <literal>DynFlags.flattenExtensionFlags</literal> once all
527           the flags and pragmas have been read.
528         </para>
529       </listitem>
530     </itemizedlist>
531   </sect2>
532
533 <!--
534   <sect2>
535     <title>Libraries</title>
536
537     <itemizedlist>
538     </itemizedlist>
539   </sect2>
540 -->
541 </sect1>
542