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