[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / docs / release_notes / 0-06-notes.lit
1 The really new thing about release 0.06 is this: if you can get
2 your program through the compiler, then it should actually work when you
3 run it! 
4
5 Another thing we have worked hard on recently is {\em documentation} (see
6 next section).
7
8 %************************************************************************
9 %*                                                                      *
10 \subsection[0-06-new-docs]{New documentation, especially for hackers!}
11 %*                                                                      *
12 %************************************************************************
13
14 See the file \tr{docs/README} for a full ``roadmap'' to all known
15 documentation.
16
17 \begin{description}
18 %-------------------------------------------------------------------
19 \item[STG-machine paper.]
20 A monster (70+-page) paper which gives a detailed description of the 
21 Spineless Tagless G-machine, on which the back end of the compiler is based.
22 Simon is Jolly Proud of this paper.
23
24 This paper isn't in the distribution, but is available by asking
25 Simon, or by FTP from \tr{ftp.dcs.glasgow.ac.uk:pub/glasgow-fp/stg.dvi}.
26 %-------------------------------------------------------------------
27 \item[\tr{imports/SMinterface.lh}.]
28 The storage manager is carefully isolated from the rest of the runtime
29 system behind a carefully identified interface.  This paper documents
30 the interface, and says a little about the implementation.  NB:
31 ``literate'' \tr{.h} file!
32 %-------------------------------------------------------------------
33 \item[\tr{docs/C_optimisation}.]
34 Lots of details about how we use C as a target language, and
35 the tricks we use to make it go fast.  Still drafty.
36 %-------------------------------------------------------------------
37 \item[\tr{docs/runtime}.]
38 The {\em beginnings} of a description of details of the runtime system
39 which aren't covered by the STG paper above.
40 %-------------------------------------------------------------------
41 \item[\tr{docs/typecheck}.]
42 The {\em beginnings} of a description of tricky corners of the type checker.
43 %-------------------------------------------------------------------
44 \item[\tr{docs/arrays}.]
45 A work-in-progress on how to handle arrays properly.
46 %-------------------------------------------------------------------
47 \item[\tr{docs/core-overview}:]
48 The beginnings of a description of the Core data type, plus the other
49 data types you need to know about to write programs which manipulate
50 the Core data type.
51
52 The ``how to add to the compiler'' document
53 (\tr{docs/add_to_compiler}) has some of this stuff in it, too.
54 %-------------------------------------------------------------------
55 \item[Type classes paper:]
56 This is a short (20-page) form of the massive ``Static Semantics of
57 Haskell'' paper.  We submitted it to Lisp and FP 1992, but they
58 (unaccountably) rejected it.
59
60 This paper isn't in the distribution; please ask for it.
61 \end{description}
62
63 %************************************************************************
64 %*                                                                      *
65 \subsection[0-06-new-in-compiler]{To do with the compiler proper}
66 %*                                                                      *
67 %************************************************************************
68
69 \begin{description}
70 %-------------------------------------------------------------------
71 %-------------------------------------------------------------------
72 \item[1.2 syntax:]
73 The parser handles the Haskell syntax given in the Haskell report,
74 version~1.2.  See \tr{parsers/hsp}.
75
76 %-------------------------------------------------------------------
77 \item[Graph reduction:]
78 Updates are in and we're doing graph reduction!  (All the bells and
79 whistles for doing a good job of [avoiding] updates are not
80 in yet.)
81
82 See \tr{compiler/codeGen/{CodeGen,CgClosure}.lhs} and
83 \tr{runtime/main/Update.lhc} for the main bits.
84
85 %-------------------------------------------------------------------
86 \item[Closure layout less deeply wired into compiler:]
87 Rather than knowing word-for-word how each closure is layed out in
88 memory, the compiler emits C macro calls to access/fill-in the ``fixed
89 header'' and ``variable header'' parts of each closure (all described
90 in the storage-manager document).
91
92 This means, for example, that the very same C code used on sequential
93 machines can be used on GRIP as well, even though closures in GRIP
94 have some extra fields---all that is required is suitable \tr{.h}
95 files to define the header macros accordingly!
96
97 Anyone whose efforts involve munging around in or pinning things onto
98 closures should like this ``feature.''
99
100 %-------------------------------------------------------------------
101 \item[Statistics about program execution:]
102 The compiler emits macro calls into the C output which, if expanded
103 (use @-DDO_RUNTIME_PROFILING@, default: on), will accumulate
104 statistics about program behaviour.  To have those statistics printed
105 out (to @stderr@), give your program the @-p@ RTS flag, thusly:
106
107 \begin{verbatim}
108 % a.out +RTS -p
109 \end{verbatim}
110
111 We welcome any interesting profiles that you may churn up!
112
113 See \tr{imports/StgProfile.h} and \tr{runtime/main/StgProfile.lc},
114 plus insertions of those macro calls in
115 \tr{compiler/codeGen}.
116
117 %-------------------------------------------------------------------
118 \item[New simplifier/transformation stuff:]
119 Contributed by research students Andr\'e Santos and Andy Gill.  In
120 \tr{compiler/simplify} and \tr{compiler/stranal-triv}; it's still
121 thoroughly experimental.
122
123 The old-but-reliable brain-damaged simplifier is now in
124 \tr{compiler/simplify0} and is still the default.
125
126 %-------------------------------------------------------------------
127 %\item[Faster compiler:]
128 % (NOT QUITE YET)  The compiler is again faster than the previous release
129 % (version~0.05).  The C output is also smaller.
130
131 %-------------------------------------------------------------------
132 \item[Compiler is compilable with Chalmers's HBC or Glasgow prototype compiler:]
133 The default set of \tr{compiler/*/*.hi} interface files in the
134 distribution are for compiling with HBC (this seems to be the people's
135 preference); version 0.997.3 or greater, please.
136
137 A separate set of \tr{.hi} files are provided for those who use the
138 Glasgow prototype compiler.  These are in the file
139 \tr{ghc-0.06-proto-hi-files.tar.Z}, available wherever you got the
140 basic distribution.  The installation document says how to deal with
141 these various blobs of files.
142
143 The possibility of using HBC means you can compile the Glasgow Haskell
144 compiler on any machine supported for HBC (Sun3s, Sun4s, DEC 3100s
145 [and one or two more flavours?]).
146 \end{description}
147
148 %************************************************************************
149 %*                                                                      *
150 \subsection[0-06-new-in-compiler-contrib]{In contributed bits of the compiler}
151 %*                                                                      *
152 %************************************************************************
153
154 \begin{description}
155 %-------------------------------------------------------------------
156 \item[Semantique strictness analyser:]
157 The one in the distribution now builds; in \tr{compiler/stranal-sem}.
158 This would only be of interest to those who might want to play with
159 it.  The rest of the compiler can't use its results.
160
161 If you want to build this strictness analyser, you need to configure
162 appropriately (see \tr{mkworld/Project-ghc-full.*}, when you get to
163 that part of the installation instructions).
164 \end{description}
165
166 Please send us {\em your} bits for next time!
167
168 %************************************************************************
169 %*                                                                      *
170 \subsection[0-06-new-in-libraries]{In @Prelude@ and runtime support}
171 %*                                                                      *
172 %************************************************************************
173
174 \begin{description}
175 %-------------------------------------------------------------------
176 \item[``Binary bloat'' from the prelude, ameliorated:]
177 The C files produced from compiling the prelude are chopped into
178 some 400 separate C files, which are individually compiled and 
179 banged into an archive.  Result is that you only get the bits you
180 ``need,'' and binary sizes have about halved.
181 (There is more work to do in this department.)
182
183 %-------------------------------------------------------------------
184 \item[Naive implementation of Haskell I/O:]
185 At least \tr{ReadChan stdin} and \tr{AppendChan stdout} requests work.
186 It shouldn't be too hard to add support for other requests in
187 \tr{lib/io/DialogueToIO.lhs}. (Only [extended] Haskell hacking needed!)
188
189 %-------------------------------------------------------------------
190 \item[Storage management moved behind a safe wall:]
191
192 It's now in \tr{runtime/storage/.}  All four flavours of garbage
193 collector (two-space copying, one-space compacting, dual-mode, and
194 Appel-like generational) seem to work.
195
196 Patrick Sansom, research student and hacker extraordinaire, did all
197 of this.
198
199 %-------------------------------------------------------------------
200 \item[Flags-to-RTS machinery in place:]
201
202 When your @ghc@-compiled Haskell program starts up, any command-line
203 arguments bracketted by @+RTS@ and @-RTS@ (or the end of the arguments)
204 are assumed to be flags for the runtime system.  These flags are used
205 to alter the heap size, ask for garbage-collection stats, etc.
206
207 To see what flags are available, try: \tr{myprog +RTS -f}.
208
209 Patrick did this, too.
210
211 %-------------------------------------------------------------------
212 \item[C-optimisation sleaziness also better hidden:]
213
214 It is in \tr{runtime/c-as-asm/}.  (It needs to be tidier, but...)
215
216 We are still actively working on getting this right.  Please get in
217 touch if you are interested.
218 \end{description}
219
220 %************************************************************************
221 %*                                                                      *
222 \subsection[0-06-new-in-mkworld]{In distribution/build/installation machinery}
223 %*                                                                      *
224 %************************************************************************
225
226 \begin{description}
227 %-------------------------------------------------------------------
228 \item[Better line numbers, and Emacs-able TAGS files:]
229 (Yes, they're related!) Error messages should come out with better
230 line numbers than before.
231
232 The distribution now includes tags-making things: souped-up \tr{etags}
233 program [for C], \tr{perltags} [for perl], and \tr{hstags} [for
234 Haskell] (mostly in \tr{utils/scripts}).  The Haskell tags program
235 uses the parser, so it Does It Right.
236
237 \tr{make tags fulltags} at the top of the distribution tree will make a
238 huge TAGS file for the whole compilation system.
239
240 %-------------------------------------------------------------------
241 \item[\tr{make install} might do something sensible:]
242 Yes, it does.  But you'd be well advised to do a \tr{make -n install}
243 just to check first!
244 \end{description}
245
246 %************************************************************************
247 %*                                                                      *
248 \subsection[0-06-new-misc]{Miscellaneous new things}
249 %*                                                                      *
250 %************************************************************************
251
252 \begin{description}
253 %-------------------------------------------------------------------
254 \item[Consistency-checking for executables:]
255 Given that our system can generate \tr{.o} object files which are
256 seriously {\em incompatible} with each other, depending on choice of
257 garbage collector, degree of optimisation, whether or not compiling
258 for GRIP, etc., we have implemented a scheme (in the driver \tr{ghc})
259 that checks that all the linked bits in an executable ``belong''
260 together.
261
262 %-------------------------------------------------------------------
263 \item[Scripts from Denis Howe:]
264 We have included his \tr{fptags} and \tr{mira2hs} scripts that he
265 posted to \tr{comp.lang.functional}.
266 \end{description}