summaryrefslogtreecommitdiff
path: root/docs/users_guide/intro.xml
blob: 25ead9e894c21fe6ee7857d211bf25da6208ba52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<?xml version="1.0" encoding="iso-8859-1"?>
<chapter id="introduction-GHC">
  <title>Introduction to GHC</title>

  <para>This is a guide to using the Glasgow Haskell Compiler (GHC):
  an interactive and batch compilation system for the <ulink
  url="http://www.haskell.org/">Haskell&nbsp;98</ulink>
  language.</para>

  <para>GHC has two main components: an interactive Haskell
  interpreter (also known as GHCi), described in <xref
  linkend="ghci"/>, and a batch compiler, described throughout <xref
  linkend="using-ghc"/>.  In fact, GHC consists of a single program
  which is just run with different options to provide either the
  interactive or the batch system.</para>

  <para>The batch compiler can be used alongside GHCi: compiled
  modules can be loaded into an interactive session and used in the
  same way as interpreted code, and in fact when using GHCi most of
  the library code will be pre-compiled.  This means you get the best
  of both worlds: fast pre-compiled library code, and fast compile
  turnaround for the parts of your program being actively
  developed.</para>

  <para>GHC supports numerous language extensions, including
  concurrency, a foreign function interface, exceptions, type system
  extensions such as multi-parameter type classes, local universal and
  existential quantification, functional dependencies, scoped type
  variables and explicit unboxed types.  These are all described in
  <xref linkend="ghc-language-features"/>.</para>

  <para>GHC has a comprehensive optimiser, so when you want to Really
  Go For It (and you've got time to spare) GHC can produce pretty fast
  code.  Alternatively, the default option is to compile as fast as
  possible while not making too much effort to optimise the generated
  code (although GHC probably isn't what you'd describe as a fast
  compiler :-).</para>
  
  <para>GHC's profiling system supports &ldquo;cost centre
  stacks&rdquo;: a way of seeing the profile of a Haskell program in a
  call-graph like structure.  See <xref linkend="profiling"/> for more
  details.</para>

  <para>GHC comes with a number of libraries. These are
  described in separate documentation.</para>

  <sect1 id="mailing-lists-GHC">
    <title>Meta-information: Web sites, mailing lists, etc.</title>

    <indexterm><primary>mailing lists, Glasgow Haskell</primary></indexterm>
    <indexterm><primary>Glasgow Haskell mailing lists</primary></indexterm>

    <para>On the World-Wide Web, there are several URLs of likely
    interest:</para>

    <itemizedlist>
      <listitem>
	<para><ulink url="http://www.haskell.org/" >Haskell home
	page</ulink></para>
      </listitem>

      <listitem>
	<para><ulink url="http://www.haskell.org/ghc/">GHC home
	page</ulink></para>
      </listitem>

      <listitem>
	<para><ulink
	url="http://www.cs.nott.ac.uk/~gmh/faq.html">comp.lang.functional
	FAQ</ulink></para>
      </listitem>

    </itemizedlist>

    <para>We run the following mailing lists about Glasgow Haskell.
    We encourage you to join, as you feel is appropriate.</para>

    <variablelist>
      <varlistentry>
	<term>glasgow-haskell-users:</term>
	<listitem>
	  <para>This list is for GHC users to chat among themselves.
	  If you have a specific question about GHC, please check the
	  <ulink
	  url="http://www.haskell.org/haskellwiki/GHC/FAQ">FAQ</ulink>
	  first.</para>

	  <variablelist>
	    <varlistentry>
	      <term>list email address:</term>
	      <listitem>
		<para><email>glasgow-haskell-users@haskell.org</email></para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>subscribe at:</term> 
	      <listitem>
		<para><ulink
	      url="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users"><literal>http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</literal></ulink>.</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>admin email address:</term>
	      <listitem>
		<para><email>glasgow-haskell-users-admin@haskell.org</email></para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>list archives:</term>
	      <listitem>
		<para><ulink
          url="http://www.haskell.org/pipermail/glasgow-haskell-users/"><literal>http://www.haskell.org/pipermail/glasgow-haskell-users/</literal></ulink></para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>cvs-ghc:</term>
	<listitem>
	  <para>The hardcore GHC developers hang out here.  This list
	  also gets commit message from the GHC darcs repository.  There are
	  other lists for other darcs
	  repositories (most notably <literal>cvs-libraries</literal>).
	  </para>
	  
	  <variablelist>
	    <varlistentry>
	      <term>list email address:</term>
	      <listitem>
		<para><email>cvs-ghc@haskell.org</email></para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>subscribe at:</term> 
	      <listitem>
		<para><ulink
	      url="http://www.haskell.org/mailman/listinfo/cvs-ghc"><literal>http://www.haskell.org/mailman/listinfo/cvs-ghc</literal></ulink>.</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>admin email address:</term>
	      <listitem>
		<para><email>cvs-ghc-admin@haskell.org</email></para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>list archives:</term>
	      <listitem>
		<para><ulink
          url="http://www.haskell.org/pipermail/cvs-ghc/"><literal>http://www.haskell.org/pipermail/cvs-ghc/</literal></ulink></para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</listitem>
      </varlistentry>
    </variablelist>

    <para>There are several other haskell and GHC-related mailing
    lists served by <literal>www.haskell.org</literal>.  Go to <ulink
    url="http://www.haskell.org/mailman/listinfo/"><literal>http://www.haskell.org/mailman/listinfo/</literal></ulink>
    for the full list.</para>

    <para>Some Haskell-related discussion also takes place in the
    Usenet newsgroup <literal>comp.lang.functional</literal>.</para>

  </sect1>

  <sect1 id="bug-reporting">
    <title>Reporting bugs in GHC</title>
    <indexterm><primary>bugs</primary><secondary>reporting</secondary>
    </indexterm>
    <indexterm><primary>reporting bugs</primary>
    </indexterm>

    <para>
        Glasgow Haskell is a changing system so there are sure to be
        bugs in it. If you find one, please see
        <ulink url="http://hackage.haskell.org/trac/ghc/wiki/ReportABug">this wiki page</ulink>
        for information on how to report it.
    </para>

  </sect1>

  <sect1 id="version-numbering">
    <title>GHC version numbering policy</title>
    <indexterm><primary>version, of ghc</primary></indexterm>

    <para>As of GHC version 6.8, we have adopted the following policy
    for numbering GHC versions:</para>

    <variablelist>
      <varlistentry>
	<term>Stable Releases</term>
	<listitem>
	  <para>Stable branches are numbered <literal><replaceable>x</replaceable>.<replaceable>y</replaceable></literal>, where
	  <replaceable>y</replaceable> is <emphasis>even</emphasis>.
	  Releases on the stable branch <literal><replaceable>x</replaceable>.<replaceable>y</replaceable></literal> are numbered <literal><replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>z</replaceable></literal>, where
	  <replaceable>z</replaceable> (>= 1) is the patchlevel number.
	  Patchlevels are bug-fix releases only, and never
	  change the programmer interface to any system-supplied code.
	  However, if you install a new patchlevel over an old one you
	  will need to recompile any code that was compiled against the
	  old libraries.</para>

	  <para>The value of <literal>__GLASGOW_HASKELL__</literal>
	  (see <xref linkend="c-pre-processor"/>) for a major release
	  <literal><replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>z</replaceable></literal>
	  is the integer <replaceable>xyy</replaceable> (if
	  <replaceable>y</replaceable> is a single digit, then a leading zero
	  is added, so for example in version 6.8.2 of GHC we would have
	  <literal>__GLASGOW_HASKELL__==608</literal>).</para>
	  <indexterm>
	    <primary><literal>__GLASGOW_HASKELL__</literal></primary>
	  </indexterm>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term>Stable snapshots</term>
	<listitem>
	  <para>
      We may make snapshot releases of the current
      stable branch <ulink url="http://www.haskell.org/ghc/dist/stable/dist/">available for download</ulink>, and the latest sources are available from <ulink url="http://hackage.haskell.org/trac/ghc/wiki/DarcsRepositories">the darcs repositories</ulink>.
	  </para>

	  <para>Stable snapshot releases are named
	  <literal><replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>z</replaceable>.<replaceable>YYYYMMDD</replaceable></literal>.
	  where <literal><replaceable>YYYYMMDD</replaceable></literal> is the date of the sources
	  from which the snapshot was built, and <literal><replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>z+1</replaceable></literal> is the next release to be made on that branch.
	  For example, <literal>6.8.1.20040225</literal> would be a
	  snapshot of the <literal>6.8</literal> branch during the development
      of <literal>6.8.2</literal>.</para>

	  <para>The value of <literal>__GLASGOW_HASKELL__</literal>
	  for a snapshot release is the integer
	  <replaceable>xyy</replaceable>.  You should never write any
	  conditional code which tests for this value, however: since
	  interfaces change on a day-to-day basis, and we don't have
	  finer granularity in the values of
	  <literal>__GLASGOW_HASKELL__</literal>, you should only
	  conditionally compile using predicates which test whether
	  <literal>__GLASGOW_HASKELL__</literal> is equal to, later
	  than, or earlier than a given major release.</para>
	  <indexterm>
	    <primary><literal>__GLASGOW_HASKELL__</literal></primary>
	  </indexterm>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>Unstable snapshots</term>
	<listitem>
	  <para>
      We may make snapshot releases of the
      HEAD <ulink url="http://www.haskell.org/ghc/dist/current/dist/">available for download</ulink>, and the latest sources are available from <ulink url="http://hackage.haskell.org/trac/ghc/wiki/DarcsRepositories">the darcs repositories</ulink>.
	  </para>

	  <para>Unstable snapshot releases are named
	  <literal><replaceable>x</replaceable>.<replaceable>y</replaceable>.<replaceable>YYYYMMDD</replaceable></literal>.
	  where <literal><replaceable>YYYYMMDD</replaceable></literal> is the date of the sources
	  from which the snapshot was built.
	  For example, <literal>6.7.20040225</literal> would be a
	  snapshot of the HEAD before the creation of the
      <literal>6.8</literal> branch.</para>

	  <para>The value of <literal>__GLASGOW_HASKELL__</literal>
	  for a snapshot release is the integer
	  <replaceable>xyy</replaceable>.  You should never write any
	  conditional code which tests for this value, however: since
	  interfaces change on a day-to-day basis, and we don't have
	  finer granularity in the values of
	  <literal>__GLASGOW_HASKELL__</literal>, you should only
	  conditionally compile using predicates which test whether
	  <literal>__GLASGOW_HASKELL__</literal> is equal to, later
	  than, or earlier than a given major release.</para>
	  <indexterm>
	    <primary><literal>__GLASGOW_HASKELL__</literal></primary>
	  </indexterm>
	</listitem>
      </varlistentry>
    </variablelist>
    
    <para>The version number of your copy of GHC can be found by
    invoking <literal>ghc</literal> with the
    <literal>&ndash;&ndash;version</literal> flag (see <xref
    linkend="options-help"/>).</para>
  </sect1>


&relnotes;

</chapter>

<!-- Emacs stuff:
     ;;; Local Variables: ***
     ;;; mode: xml ***
     ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
     ;;; End: ***
 -->