1 <chapter id="introduction-GHC">
2 <title>Introduction to GHC</title>
4 <para>This is a guide to using the Glasgow Haskell Compiler (GHC):
5 an interactive and batch compilation system for the <ulink
6 url="http://www.haskell.org/">Haskell 98</ulink>
9 <para>GHC has two main components: an interactive Haskell
10 interpreter (also known as GHCi), described in <xref
11 linkend="ghci">, and a batch compiler, described throughout <xref
12 linkend="using-ghc">. In fact, GHC consists of a single program
13 which is just run with different options to provide either the
14 interactive or the batch system.</para>
16 <para>The batch compiler can be used alongside GHCi: compiled
17 modules can be loaded into an interactive session and used in the
18 same way as interpreted code, and in fact when using GHCi most of
19 the library code will be pre-compiled. This means you get the best
20 of both worlds: fast pre-compiled library code, and fast compile
21 turnaround for the parts of your program being actively
24 <para>GHC supports numerous language extensions, including
25 concurrency, a foreign function interface, exceptions, type system
26 extensions such as multi-parameter type classes, local universal and
27 existential quantification, functional dependencies, scoped type
28 variables and explicit unboxed types. These are all described in
29 <xref linkend="ghc-language-features">.</para>
31 <para>GHC has a comprehensive optimiser, so when you want to Really
32 Go For It (and you've got time to spare) GHC can produce pretty fast
33 code. Alternatively, the default option is to compile as fast as
34 possible while not making too much effort to optimise the generated
35 code (although GHC probably isn't what you'd describe as a fast
38 <para>GHC's profiling system supports “cost centre
39 stacks”: a way of seeing the profile of a Haskell program in a
40 call-graph like structure. See <xref linkend="profiling"> for more
43 <para>GHC comes with a large collection of libraries, with
44 everything from parser combinators to networking. These are all
45 described in <xref linkend="book-hslibs">.</para>
47 <Sect1 id="mailing-lists-GHC">
48 <Title>Meta-information: Web sites, mailing lists, etc.</Title>
50 <IndexTerm><Primary>mailing lists, Glasgow Haskell</Primary></IndexTerm>
51 <IndexTerm><Primary>Glasgow Haskell mailing lists</Primary></IndexTerm>
53 <para>On the World-Wide Web, there are several URLs of likely
58 <para><ulink URL="http://www.haskell.org/" >Haskell home
63 <para><ulink URL="http://www.haskell.org/ghc/">GHC home
69 URL="http://www.cs.nott.ac.uk/Department/Staff/mpj/faq.html">comp.lang.functional
75 <para>We run the following mailing lists about Glasgow Haskell.
76 We encourage you to join, as you feel is appropriate.</para>
80 <term>glasgow-haskell-users:</term>
82 <para>This list is for GHC users to chat among
87 <term>list email address:</term>
89 <para><email>glasgow-haskell-users@haskell.org</email></para>
94 <term>subscribe at:</term>
97 url="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users"><literal>http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</literal></ulink>.</para>
102 <term>admin email address:</term>
104 <para><email>glasgow-haskell-users-admin@haskell.org</email></para>
109 <term>list archives:</term>
112 url="http://www.haskell.org/pipermail/glasgow-haskell-users/"><literal>http://www.haskell.org/pipermail/glasgow-haskell-users/</literal></ulink></para>
120 <term>glasgow-haskell-bugs:</term>
122 <para>Send bug reports for GHC to this address! The sad and
123 lonely people who subscribe to this list will muse upon
124 what's wrong and what you might do about it.</para>
128 <term>list email address:</term>
130 <para><email>glasgow-haskell-bugs@haskell.org</email></para>
135 <term>subscribe at:</term>
138 url="http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs"><literal>http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs</literal></ulink>.</para>
143 <term>admin email address:</term>
145 <para><email>glasgow-haskell-bugs-admin@haskell.org</email></para>
150 <term>list archives:</term>
153 url="http://www.haskell.org/pipermail/glasgow-haskell-bugs/"><literal>http://www.haskell.org/pipermail/glasgow-haskell-bugs/</literal></ulink></para>
161 <term>cvs-ghc:</term>
163 <para>The hardcore GHC developers hang out here. This list
164 also gets commit message from the CVS repository. There are
165 several other similar lists for other parts of the CVS
166 repository (eg. <literal>cvs-hslibs</literal>,
167 <literal>cvs-happy</literal>, <literal>cvs-hdirect</literal>
172 <term>list email address:</term>
174 <para><email>cvs-ghc@haskell.org</email></para>
179 <term>subscribe at:</term>
182 url="http://www.haskell.org/mailman/listinfo/cvs-ghc"><literal>http://www.haskell.org/mailman/listinfo/cvs-ghc</literal></ulink>.</para>
187 <term>admin email address:</term>
189 <para><email>cvs-ghc-admin@haskell.org</email></para>
194 <term>list archives:</term>
197 url="http://www.haskell.org/pipermail/cvs-ghc/"><literal>http://www.haskell.org/pipermail/cvs-ghc/</literal></ulink></para>
205 <para>There are several other haskell and GHC-related mailing
206 lists served by <literal>www.haskell.org</literal>. Go to <ulink
207 url="http://www.haskell.org/mailman/listinfo/"><literal>http://www.haskell.org/mailman/listinfo/</literal></ulink>
208 for the full list.</para>
210 <para>Some Haskell-related discussion also takes place in the
211 Usenet newsgroup <literal>comp.lang.functional</literal>.</para>
215 <sect1 id="version-numbering">
216 <title>GHC version numbering policy</title>
217 <indexterm><primary>version, of ghc</primary></indexterm>
219 <para>As of GHC version 4.08, we have adopted the following
220 policy for numbering GHC versions:</para>
224 <term>Stable Releases</term>
226 <para>These are numbered <literal>x.yy.z</literal>, where
227 <literal>yy</literal> is <emphasis>even</emphasis>, and
228 <literal>z</literal> is the patchlevel number (the trailing
229 <literal>.z</literal> can be omitted if <literal>z</literal>
230 is zero). Patchlevels are bug-fix releases only, and never
231 change the programmer interface to any system-supplied code.
232 However, if you install a new patchlevel over an old one you
233 will need to recompile any code that was compiled against the
234 old libraries.</para>
236 <para>The value of <literal>__GLASGOW_HASKELL__</literal>
237 (see <xref linkend="c-pre-processor">) for a major release
238 <literal>x.yy.z</literal> is the integer
239 <literal>xyy</literal>.</para>
241 <primary><literal>__GLASGOW_HASKELL__</literal></primary>
247 <term>Snapshots/unstable releases</term>
249 <para>We may make snapshot releases of the current
250 development sources from time to time, and the current
251 sources are always available via the CVS repository (see the
252 GHC web site for details).</para>
254 <para>Snapshot releases are named
255 <literal>x.yy.YYYYMMDD</literal> where <literal>yy</literal>
256 is <emphasis>odd</emphasis>, and <literal>YYYYMMDD</literal>
257 is the date of the sources from which the snapshot was
258 built. In theory, you can check out the exact same sources
259 from the CVS repository using this date.</para>
261 <para>The value of <literal>__GLASGOW_HASKELL__</literal>
262 for a snapshot release is the integer
263 <literal>xyy</literal>. You should never write any
264 conditional code which tests for this value, however: since
265 interfaces change on a day-to-day basis, and we don't have
266 finer granularity in the values of
267 <literal>__GLASGOW_HASKELL__</literal>, you should only
268 conditionally compile using predicates which test whether
269 <literal>__GLASGOW_HASKELL__</literal> is equal to, later
270 than, or earlier than a given major release.</para>
272 <primary><literal>__GLASGOW_HASKELL__</literal></primary>
278 <para>The version number of your copy of GHC can be found by
279 invoking <literal>ghc</literal> with the
280 <literal>--version</literal> flag (see <xref
281 linkend="options-help">).</para>
290 ;;; Local Variables: ***
292 ;;; sgml-parent-document: ("users_guide.sgml" "book" "chapter") ***