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
|
The really new thing about release 0.06 is this: if you can get
your program through the compiler, then it should actually work when you
run it!
Another thing we have worked hard on recently is {\em documentation} (see
next section).
%************************************************************************
%* *
\subsection[0-06-new-docs]{New documentation, especially for hackers!}
%* *
%************************************************************************
See the file \tr{docs/README} for a full ``roadmap'' to all known
documentation.
\begin{description}
%-------------------------------------------------------------------
\item[STG-machine paper.]
A monster (70+-page) paper which gives a detailed description of the
Spineless Tagless G-machine, on which the back end of the compiler is based.
Simon is Jolly Proud of this paper.
This paper isn't in the distribution, but is available by asking
Simon, or by FTP from \tr{ftp.dcs.glasgow.ac.uk:pub/glasgow-fp/stg.dvi}.
%-------------------------------------------------------------------
\item[\tr{imports/SMinterface.lh}.]
The storage manager is carefully isolated from the rest of the runtime
system behind a carefully identified interface. This paper documents
the interface, and says a little about the implementation. NB:
``literate'' \tr{.h} file!
%-------------------------------------------------------------------
\item[\tr{docs/C_optimisation}.]
Lots of details about how we use C as a target language, and
the tricks we use to make it go fast. Still drafty.
%-------------------------------------------------------------------
\item[\tr{docs/runtime}.]
The {\em beginnings} of a description of details of the runtime system
which aren't covered by the STG paper above.
%-------------------------------------------------------------------
\item[\tr{docs/typecheck}.]
The {\em beginnings} of a description of tricky corners of the type checker.
%-------------------------------------------------------------------
\item[\tr{docs/arrays}.]
A work-in-progress on how to handle arrays properly.
%-------------------------------------------------------------------
\item[\tr{docs/core-overview}:]
The beginnings of a description of the Core data type, plus the other
data types you need to know about to write programs which manipulate
the Core data type.
The ``how to add to the compiler'' document
(\tr{docs/add_to_compiler}) has some of this stuff in it, too.
%-------------------------------------------------------------------
\item[Type classes paper:]
This is a short (20-page) form of the massive ``Static Semantics of
Haskell'' paper. We submitted it to Lisp and FP 1992, but they
(unaccountably) rejected it.
This paper isn't in the distribution; please ask for it.
\end{description}
%************************************************************************
%* *
\subsection[0-06-new-in-compiler]{To do with the compiler proper}
%* *
%************************************************************************
\begin{description}
%-------------------------------------------------------------------
%-------------------------------------------------------------------
\item[1.2 syntax:]
The parser handles the Haskell syntax given in the Haskell report,
version~1.2. See \tr{parsers/hsp}.
%-------------------------------------------------------------------
\item[Graph reduction:]
Updates are in and we're doing graph reduction! (All the bells and
whistles for doing a good job of [avoiding] updates are not
in yet.)
See \tr{compiler/codeGen/{CodeGen,CgClosure}.lhs} and
\tr{runtime/main/Update.lhc} for the main bits.
%-------------------------------------------------------------------
\item[Closure layout less deeply wired into compiler:]
Rather than knowing word-for-word how each closure is layed out in
memory, the compiler emits C macro calls to access/fill-in the ``fixed
header'' and ``variable header'' parts of each closure (all described
in the storage-manager document).
This means, for example, that the very same C code used on sequential
machines can be used on GRIP as well, even though closures in GRIP
have some extra fields---all that is required is suitable \tr{.h}
files to define the header macros accordingly!
Anyone whose efforts involve munging around in or pinning things onto
closures should like this ``feature.''
%-------------------------------------------------------------------
\item[Statistics about program execution:]
The compiler emits macro calls into the C output which, if expanded
(use @-DDO_RUNTIME_PROFILING@, default: on), will accumulate
statistics about program behaviour. To have those statistics printed
out (to @stderr@), give your program the @-p@ RTS flag, thusly:
\begin{verbatim}
% a.out +RTS -p
\end{verbatim}
We welcome any interesting profiles that you may churn up!
See \tr{imports/StgProfile.h} and \tr{runtime/main/StgProfile.lc},
plus insertions of those macro calls in
\tr{compiler/codeGen}.
%-------------------------------------------------------------------
\item[New simplifier/transformation stuff:]
Contributed by research students Andr\'e Santos and Andy Gill. In
\tr{compiler/simplify} and \tr{compiler/stranal-triv}; it's still
thoroughly experimental.
The old-but-reliable brain-damaged simplifier is now in
\tr{compiler/simplify0} and is still the default.
%-------------------------------------------------------------------
%\item[Faster compiler:]
% (NOT QUITE YET) The compiler is again faster than the previous release
% (version~0.05). The C output is also smaller.
%-------------------------------------------------------------------
\item[Compiler is compilable with Chalmers's HBC or Glasgow prototype compiler:]
The default set of \tr{compiler/*/*.hi} interface files in the
distribution are for compiling with HBC (this seems to be the people's
preference); version 0.997.3 or greater, please.
A separate set of \tr{.hi} files are provided for those who use the
Glasgow prototype compiler. These are in the file
\tr{ghc-0.06-proto-hi-files.tar.Z}, available wherever you got the
basic distribution. The installation document says how to deal with
these various blobs of files.
The possibility of using HBC means you can compile the Glasgow Haskell
compiler on any machine supported for HBC (Sun3s, Sun4s, DEC 3100s
[and one or two more flavours?]).
\end{description}
%************************************************************************
%* *
\subsection[0-06-new-in-compiler-contrib]{In contributed bits of the compiler}
%* *
%************************************************************************
\begin{description}
%-------------------------------------------------------------------
\item[Semantique strictness analyser:]
The one in the distribution now builds; in \tr{compiler/stranal-sem}.
This would only be of interest to those who might want to play with
it. The rest of the compiler can't use its results.
If you want to build this strictness analyser, you need to configure
appropriately (see \tr{mkworld/Project-ghc-full.*}, when you get to
that part of the installation instructions).
\end{description}
Please send us {\em your} bits for next time!
%************************************************************************
%* *
\subsection[0-06-new-in-libraries]{In @Prelude@ and runtime support}
%* *
%************************************************************************
\begin{description}
%-------------------------------------------------------------------
\item[``Binary bloat'' from the prelude, ameliorated:]
The C files produced from compiling the prelude are chopped into
some 400 separate C files, which are individually compiled and
banged into an archive. Result is that you only get the bits you
``need,'' and binary sizes have about halved.
(There is more work to do in this department.)
%-------------------------------------------------------------------
\item[Naive implementation of Haskell I/O:]
At least \tr{ReadChan stdin} and \tr{AppendChan stdout} requests work.
It shouldn't be too hard to add support for other requests in
\tr{lib/io/DialogueToIO.lhs}. (Only [extended] Haskell hacking needed!)
%-------------------------------------------------------------------
\item[Storage management moved behind a safe wall:]
It's now in \tr{runtime/storage/.} All four flavours of garbage
collector (two-space copying, one-space compacting, dual-mode, and
Appel-like generational) seem to work.
Patrick Sansom, research student and hacker extraordinaire, did all
of this.
%-------------------------------------------------------------------
\item[Flags-to-RTS machinery in place:]
When your @ghc@-compiled Haskell program starts up, any command-line
arguments bracketted by @+RTS@ and @-RTS@ (or the end of the arguments)
are assumed to be flags for the runtime system. These flags are used
to alter the heap size, ask for garbage-collection stats, etc.
To see what flags are available, try: \tr{myprog +RTS -f}.
Patrick did this, too.
%-------------------------------------------------------------------
\item[C-optimisation sleaziness also better hidden:]
It is in \tr{runtime/c-as-asm/}. (It needs to be tidier, but...)
We are still actively working on getting this right. Please get in
touch if you are interested.
\end{description}
%************************************************************************
%* *
\subsection[0-06-new-in-mkworld]{In distribution/build/installation machinery}
%* *
%************************************************************************
\begin{description}
%-------------------------------------------------------------------
\item[Better line numbers, and Emacs-able TAGS files:]
(Yes, they're related!) Error messages should come out with better
line numbers than before.
The distribution now includes tags-making things: souped-up \tr{etags}
program [for C], \tr{perltags} [for perl], and \tr{hstags} [for
Haskell] (mostly in \tr{utils/scripts}). The Haskell tags program
uses the parser, so it Does It Right.
\tr{make tags fulltags} at the top of the distribution tree will make a
huge TAGS file for the whole compilation system.
%-------------------------------------------------------------------
\item[\tr{make install} might do something sensible:]
Yes, it does. But you'd be well advised to do a \tr{make -n install}
just to check first!
\end{description}
%************************************************************************
%* *
\subsection[0-06-new-misc]{Miscellaneous new things}
%* *
%************************************************************************
\begin{description}
%-------------------------------------------------------------------
\item[Consistency-checking for executables:]
Given that our system can generate \tr{.o} object files which are
seriously {\em incompatible} with each other, depending on choice of
garbage collector, degree of optimisation, whether or not compiling
for GRIP, etc., we have implemented a scheme (in the driver \tr{ghc})
that checks that all the linked bits in an executable ``belong''
together.
%-------------------------------------------------------------------
\item[Scripts from Denis Howe:]
We have included his \tr{fptags} and \tr{mira2hs} scripts that he
posted to \tr{comp.lang.functional}.
\end{description}
|