[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / docs / users_guide / 2-01-notes.vsgml
1 Release~2.01 is the first release of Glasgow Haskell for Haskell~1.3.
2 It represents a major step forward in GHC development since GHC~0.26
3 (July 1995).  Note that we are also releasing GHC~0.29, the current
4 state-of-play with the Haskell~1.2 compiler---at the same time as
5 2.01.
6
7 The announcement for this release is distributed as @ANNOUNCE-2.01@
8 in the top-level directory.  It contains very important caveats about
9 2.01, which we do not repeat here!
10
11 Information about ``what's ported to which machine'' is in the
12 Installation Guide.  Since 0.26, we've improved our support for iX86
13 (Intel) boxes, notably those running Linux.
14
15 %************************************************************************
16 %*                                                                      *
17 <sect1>New configuration things in 2.01
18 <label id="2-01-config">
19 <p>
20 %*                                                                      *
21 %************************************************************************
22
23 %************************************************************************
24 %*                                                                      *
25 <sect1>User-visible changes in 2.01, including incompatibilities
26 <label id="2-01-user-visible">
27 <p>
28 %*                                                                      *
29 %************************************************************************
30
31 GHC~2.01 is a compiler for Haskell~1.3 and, as such, introduces many
32 user-visible changes.  The GHC user's guide has a section to help you
33 upgrade your programs to Haskell~1.3; all user-visible changes
34 are described there (and not repeated here).
35
36 %************************************************************************
37 %*                                                                      *
38 <sect1>New or changed GHC command-line options
39 <label id="2-01-options">
40 <p>
41 %*                                                                      *
42 %************************************************************************
43
44 A new flag, @-recomp@ invokes the new ``recompilation checker.''
45 We recommend that you use it whenever you use `make' to build your
46 Haskell programs.  Please see the User's Guide for details.
47
48 The flags @-fomit-derived-read@ and
49 @-fomit-reexported-instances@ have died; there is no longer any
50 need for them.
51
52 %************************************************************************
53 %*                                                                      *
54 <sect1>New in the compiler proper
55 <label id="2-01-new-in-compiler">
56 <p>
57 %*                                                                      *
58 %************************************************************************
59
60 Substantially rewritten.  Notable points:
61 <itemize>
62 <item>
63 The typechecker, besides doing all the new 1.3
64 features (constructor classes, records, etc.), has been made
65 ready to do linear types (e.g., there are now ``usage
66 variables'' as well as ``type variables'').
67
68 <item>
69 The Core language now has one constructor for lambdas
70 (@Lam@; rather than two, @CoLam@ and @CoTyLam@);
71 also, one constructor for applications (@App@, rather
72 than two, @CoApp@ and @CoTyApp@).
73
74 Consequently, new more-general datatypes for binders and
75 arguments now exist (@CoreBinder@ and @CoreArg@,
76 respectively).
77
78 Again, the Core language is now ``linear types''-ready
79 (though the work hasn't been done yet).
80
81 A new Core constructor, @Coerce@, exists to support the
82 1.3 @newtype@ construct.
83
84 <item>
85 The ``renamer''---the part of the compiler that implements
86 the Haskell module system---has been completely rewritten.
87
88 In part, this is because the 1.3 module system is radically
89 changed from 1.2, even if the user is unlikely to notice.
90
91 We've implemented the new system with a ``go to the
92 horse's mouth'' scheme; that is, to discover the facts about
93 an entity @Foo.bar@, we <em>always</em> go to the interface
94 for module @Foo@; hence, we can never get duff information
95 about @bar@ from some intermediary.
96
97 Interface files are no longer mandated by the language, so
98 they are completely different in 2.01 compared to 0.2x.  They
99 will very likely change again.  All processing of interface
100 files is done in Haskell now (the most likely reason why GHC
101 has slowed down :-().
102
103 <item>
104 Much less special pleading for the Prelude.  If you wanted
105 to write your own Prelude and drop it in, you would have
106 a fighting chance now.
107
108 <item>
109 No more `make' dependency loops!  (Hooray!) The whole compiler
110 will build in one `make' run, no fuss or bother.
111 </itemize>
112
113 %************************************************************************
114 %*                                                                      *
115 <sect1>In the ``required'' libraries (incl. Prelude)
116 <label id="2-01-new-in-libraries">
117 <p>
118 %*                                                                      *
119 %************************************************************************
120
121 We support standard 1.3 monadic I/O, to the best of our knowledge.
122
123 The proposal for @LibPosix@ didn't make it into Haskell 1.3 I/O.
124 So it's now a system library, @-syslib posix@.  (And, of course,
125 the @Lib@ prefix is gone.)
126
127 %************************************************************************
128 %*                                                                      *
129 <sect1>New in ``Glasgow extensions'' library things
130 <label id="2-01-new-in-glaexts">
131 <p>
132 %*                                                                      *
133 %************************************************************************
134
135 The @PreludeGlaMisc@ and @PreludePrimIO@ interfaces have died.
136 Use @PreludeGlaST@ instead.
137
138 We don't really know what our interfaces-to-nonstandard-things will
139 eventually look like...
140
141 MallocPtrs now called ForeignObjs
142
143 The @_PackedString@ gunk (with leading underscores) is gone.  Just
144 @import PackedString@ and use ``normal'' names.
145
146 All of the following are <em>gone</em>:
147 <tscreen><verb>
148 data _FILE  -- corresponds to a "FILE *" in C
149
150 fclose  :: _FILE -> PrimIO Int
151 fdopen  :: Int -> String -> PrimIO _FILE
152 fflush  :: _FILE -> PrimIO Int
153 fopen   :: String -> String -> PrimIO _FILE
154 fread   :: Int -> Int -> _FILE -> PrimIO (Int, _ByteArray Int)
155 freopen :: String -> String -> _FILE -> PrimIO _FILE
156 fwrite  :: _ByteArray Int -> Int -> Int -> _FILE -> PrimIO Int
157
158 appendChanPrimIO :: String -> String -> PrimIO ()
159 appendFilePrimIO :: String -> String -> PrimIO ()
160 getArgsPrimIO    :: PrimIO [String]
161 readChanPrimIO   :: String -> PrimIO String
162 </verb></tscreen>
163
164 %************************************************************************
165 %*                                                                      *
166 <sect1>In the ``system'' libraries
167 <label id="2-01-new-in-syslibs">
168 <p>
169 %*                                                                      *
170 %************************************************************************
171
172 The ``system'' libraries are no longer part of GHC (they lived in
173 @ghc/lib/@); they have been lifted out into a subsystem in their
174 own right (they live in @hslibs@).
175
176 Of course, a GHC distribution will ``happen'' to have these libraries
177 included; however, we hope the libraries will evolve into a large,
178 flourishing, independently-maintained, and independently-distributed
179 body of code---preferably compiler-independent, too!
180
181 Renamings in the GHC system library (@hslibs/ghc/@): The function
182 @BitSet.singletonBS@ is now called @unitBS@.  Similarly,
183 @FiniteMap.singletonFM@ is now @unitFM@.  @Set.singletonSet@
184 lingers briefly; @unitSet@ is also available now.
185
186 We are <em>not</em> up-to-date with the HBC-for-1.3's HBC library (the source
187 hasn't been released yet).
188
189 The @Either@, @Maybe@, and @Option@ modules in the HBC
190 library (@hslibs/hbc/@) have been deleted---they are too close to
191 what Haskell~1.3 provides anyway (hence, confusing).
192
193 The POSIX support code is in @hslibs/posix@.
194
195 We have added a ``contrib'' system library (@hslibs/contrib/@);
196 made up of code that was contributed to the ``Haskell library'',
197 mostly by Stephen Bevan.  Quite of bit of code for numerical methods
198 in there...
199
200 %************************************************************************
201 %*                                                                      *
202 <sect1>In the runtime system
203 <label id="2-01-new-in-rts">
204 <p>
205 %*                                                                      *
206 %************************************************************************
207
208 We have made a point <em>not</em> to beat on the runtime system very much.
209 Some bugs have been fixed since 0.26, of course.
210
211 The GranSim (parallel-machine simulator) stuff is substantially improved
212 (but you're better off using the 0.29 version of it).
213
214 %************************************************************************
215 %*                                                                      *
216 %<sect1>Other new stuff
217 <label id="2-01-new-elsewhere">
218 <p>
219 %*                                                                      *
220 %************************************************************************