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