[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / docs / release_notes / 0-26-notes.lit
1 Release~0.26 is a major public release of Glasgow Haskell.
2 It incorporates our new work for the first half of 1995.
3
4 The announcement for this release is distributed as \tr{ANNOUNCE-0.26}
5 in the top-level directory.
6
7 You'll need to recompile everything if you're switching from a
8 previous version of GHC.  (If you don't, you'll get ``consistency
9 errors''.)  Some day, we will stop doing this to you :-)
10
11 Information about ``what's ported to which machine'' is now given in
12 the Installation Guide.
13 The new ports since 0.23 are: \tr{hppa1.1-hp-hpux},
14 \tr{i386-*-linuxaout}, and \tr{mips-sgi-irix5}.
15
16 %************************************************************************
17 %*                                                                      *
18 \subsection[0-26-config]{New configuration things in 0.26}
19 %*                                                                      *
20 %************************************************************************
21
22 We are moving towards one \tr{configure} script for all Glasgow
23 functional-programming tools.  Consequently, the configure options
24 have been tweaked.  Doing \tr{./configure --help} will show you the
25 current state of play.
26
27 %************************************************************************
28 %*                                                                      *
29 \subsection[0-26-user-visible]{User-visible changes in 0.26, including incompatibilities}
30 %*                                                                      *
31 %************************************************************************
32
33 The names \tr{scc}, \tr{ccall}, and \tr{casm} are no longer stolen
34 from the user's name space.  (The magical constructs they once were
35 have been known as \tr{_scc_}, \tr{_ccall_}, and \tr{_casm_} for some
36 time now...)
37
38 Similarly, \tr{trace} is no longer built-in (so you can use the name
39 if you want to).  You can get \tr{trace} either as \tr{_trace}
40 (Glasgow extension), or as itself via \tr{import Trace} with
41 \tr{-syslib hbc} (i.e., exactly like HBC).
42
43 Lazy, or irrefutable, patterns with unboxed-type components are
44 no longer allowed.  You'll need to rewrite \tr{let (I# x) = exp ...}
45 as \tr{let x = case exp of { I# i -> i } in ... }.
46
47 GHC now supports hexadecimal and octal numeric syntax for integer constants.
48 (But \tr{read} doesn't grok it yet...)
49
50 GHC now supports specialised instances (as in HBC); you can write:
51 \begin{verbatim}
52 instance Eq a => Eq (Foo a) where { ... }
53 {-# SPECIALIZE instance Eq (Foo Bool) #-}
54 \end{verbatim}
55
56 GHC's pragmas for specialised values now have a magical \tr{= blah}
57 form, in which you specify the code to be used for the specialised value.
58 For example:
59 \begin{verbatim}
60 f :: Ord a => a -> Int -> a
61 {-# SPECIALIZE f :: Double -> Int -> Double = f_Double #-}
62
63 f_Double :: Double -> Int -> Double
64 f_Double ...
65 \end{verbatim}
66 In some cases, the \tr{= blah} form can be a {\em big} win.
67
68 What we used to call ``threaded'' Haskell, we now call ``Concurrent
69 Haskell.''  And there's a paper about it.  Please see the User's Guide.
70
71 ``Parallel Haskell,'' running under PVM, is here.  Again, see the
72 User's Guide.
73
74 %************************************************************************
75 %*                                                                      *
76 \subsection[0-26-options]{New or changed GHC command-line options}
77 %*                                                                      *
78 %************************************************************************
79
80 The \tr{-g}, \tr{-p}, \tr{-pg}, \tr{-fpic}, and \tr{-fPIC} are no
81 longer passed straight through to GCC.  They probably buy you nothing,
82 while potentially causing substantial mischief.  If you know what you're doing,
83 you can still use them, via \tr{-optcO-...}.
84
85 The main option for Concurrent Haskell is \tr{-concurrent}; for
86 Parallel Haskell, it's \tr{-parallel}.
87
88 The \tr{-dict-all} option, used with \tr{-prof}, has died.  It never
89 did anything anyway.
90
91 Besides the \tr{-fshow-specialisations} option to see what specialisations
92 have occurred, you may also use the \tr{-fshow-import-specs} option
93 to see what specialisations GHC would like to have had available.
94 By then adding these ``desirable'' pragmas to your code, you can
95 squash most of the overloading from your program.
96
97 There are some new sanity-checking options.  Use
98 \tr{-fsignatures-required} if you want to force all top-level
99 definitions to have type signatures.  Use \tr{-fshadowing-not-ok}
100 if you want to disallow name shadowing.  You can't use the latter on
101 modules that include circular definitions.
102
103 The \tr{-Rghc-timing} option gives a convenient one-line summary to
104 GHC's runtime and heap allocation.
105
106 The \tr{-odump} option may be used to save GHC's standard-error output
107 to a file. (It normally shows up on your screen.)
108
109 You can now use \tr{-H0} and \tr{-K0} to reset the heap and stack
110 sizes.  As these sizes are normally ``maxxed up'' (\tr{-H32m -H16m}
111 gets you a 32MB heap), you can use this form to decrease the size:
112 \tr{-H6m -H0 -H250k} gives you a heap of 250KB.
113
114 %************************************************************************
115 %*                                                                      *
116 \subsection[0-26-io]{New in monadic I/O}
117 %*                                                                      *
118 %************************************************************************
119
120 GHC~0.26 is still a Haskell~1.2 compiler (and will remain so until
121 there is a non-DRAFT 1.3 standard).
122
123 We killed the \tr{PreludePrimIO} interface.  You can get all the same
124 functions from \tr{PreludeGlaST}.
125
126 All the \tr{_IVar} and \tr{_MVar} operations are now in the 1.3
127 \tr{IO} monad, not the non-standard \tr{PrimIO} monad.  You now
128 get them from \tr{Concurrent}, not from \tr{PreludeGlaST}.
129
130 %************************************************************************
131 %*                                                                      *
132 \subsection[0-26-new-in-compiler]{New in the compiler proper}
133 %*                                                                      *
134 %************************************************************************
135
136 The main new things are ``foldr-build'' deforestation (by Andy Gill)
137 and ever-more-glorious specialisation (by Patrick Sansom).
138
139 And the usual few megabytes of gratuitous changes.
140
141 %************************************************************************
142 %*                                                                      *
143 \subsection[0-26-new-in-libraries]{In the prelude and libraries}
144 %*                                                                      *
145 %************************************************************************
146
147 All of the basic state-transformer stuff now comes from
148 \tr{PreludeGlaST}.  The \tr{PreludePrimIO} interface no longer exists.
149
150 The function \tr{foldrPrimIO} went away.  The function \tr{forkPrimIO}
151 sprang to life.
152
153 The what-you-need-for-Concurrent-Haskell interface is \tr{Concurrent}.
154 The GHC option is \tr{-concurrent}.  Please see the User's Guide.  
155 Note that the operations @threadDelay@ and @threadWait@ now come
156 from \tr{Concurrent}, not \tr{PreludeGlaMisc}.
157
158 I-Vars and M-Vars (synchronising variables) are now
159 specifically I/O operations, not general state-transformer operations.
160 They also come from the \tr{Concurrent} interface.
161
162 Renamings: what used to be the \tr{newMVar} operation is now called
163 \tr{newEmptyMVar}; what was \tr{initMVar} is now \tr{newMVar}.
164
165 The what-you-need-for-Parallel-Haskell interface is \tr{Parallel}.
166 The GHC option is \tr{-parallel}.  At the moment, the \tr{Parallel}
167 interface just provides \tr{par} and \tr{seq}.  But that will change.
168
169 \tr{LibPosix} now provides \tr{runProcess}, our candidate for the
170 high-level OS-independent operation.
171
172 NEW: The \tr{Regex} (\tr{-syslib ghc}) interface provides direct
173 access to the GNU regexp (regular expressions on strings) package.
174 The \tr{MatchPS} interface is higher-level, providing string-matching
175 functions on \tr{_PackedStrings}.  (All by Sigbjorn Finne)
176
177 NEW: The \tr{Readline} interface (also \tr{-syslib ghc}) provides
178 access to the GNU readline package.  Instant command-line editing
179 for your Haskell programs.  (By Darren Moffat)
180
181 NEW: A ``network interface toolkit'' by Darren Moffat.  BSD sockets
182 for Haskell---way cool.
183
184 The \tr{FiniteMap} module has two new functions, \tr{isEmptyFM} and
185 \tr{elemFM}.
186
187 The \tr{Maybes} module now uses the Haskell~1.3 built-in \tr{Maybe}
188 type; you should use \tr{-fhaskell-1.3} with this module now.
189
190 The HBC library modules \tr{Maybe}, \tr{Either}, and \tr{Option} are
191 {\em gone}.  Just use \tr{-fhaskell-1.3} and get the types directly
192 from the Prelude.
193
194 All system-library modules that use the \tr{Maybe} type now require
195 \tr{-fhaskell-1.3}.  For the GHC library, that means \tr{FiniteMap},
196 \tr{Maybes}, \tr{Util}, \tr{Set}, \tr{Regex}, and \tr{MatchPS}.  For
197 the HBC library, that means \tr{ListUtil}, \tr{Native}, and
198 \tr{Parse}.  (In some cases, you could avoid the \tr{-fhaskell-1.3}
199 requirement by doing selective imports.)
200
201 GHC now supports \tr{trace} exactly like HBC: \tr{import Trace} and
202 do \tr{-syslib hbc}.  The built-in no-import-required version
203 is now called \tr{_trace}.
204
205 Instances for \tr{Shorts} and \tr{Bytes} have been added to the
206 HBC library module \tr{Word}.
207
208 As part of the GHC system library, we now provide an interface to the
209 GNU regexp (regular-expression) library; the \tr{Regexp} interface.
210 A higher-level interface, to do matches on \tr{_PackedString}s comes
211 from the \tr{MatchPS} interface.
212
213 We no longer provide specialisations of Prelude functions to the
214 \tr{Float} type; only to \tr{Double}.  It saves space, and we want to
215 discourage the use of single-precision floating-point.
216
217 %************************************************************************
218 %*                                                                      *
219 \subsection[0-26-new-in-rts]{In the runtime system}
220 %*                                                                      *
221 %************************************************************************
222
223 GHC now supplies some very simple ``hooks'' to let you change the
224 failure messages for stack and heap overflow, \tr{error}, and
225 pattern-matching failure.  Please see the User's Guide.
226
227 You can now force garbage collection after every N bytes of allocation
228 (presumably for stats collection, or something).  Use the \tr{-j} RTS
229 option.
230
231 ``Squeezing out'' update frames at garbage-collection time is now {\em
232 on} by default.  (You can turn it off with the \tr{-Z} RTS option, but
233 I can't think why you would want to.)
234
235 %************************************************************************
236 %*                                                                      *
237 \subsection[0-26-new-elsewhere]{Other new stuff}
238 %*                                                                      *
239 %************************************************************************
240
241 The GHC distribution now includes an ``examples'' directory, including
242 a simple shell (\tr{hsh} and quite a few to do with 1.3 I/O
243 (\tr{ioNNN}) and \tr{LibPosix} (\tr{poNNN}).  All in
244 \tr{ghc/misc/examples}...