Commit c7f8f1e6 authored by rrt's avatar rrt
Browse files

[project @ 2000-01-05 11:14:06 by rrt]

VSGML files changed back to plain SGML during change from LinuxDoc to DocBook.
parent bb0b4b69
<sect1>Release notes for version~4.00---10/98
<label id="release-4-00">
<p>
<sect2>Language matters
<p>
<itemize>
<item> Universal and existential quantification: see Section <ref
name="Explicit universal quantification"
id="universal-quantification"> and Section <ref name="Existentially
quantified data constructors" id="existential-quantification">
respectively.
Universal quantification was in in GHC 2.10 and later, but the
syntax has changed: it's now <tt>forall a. ...</tt> instead of <tt>All a =&gt; ...</tt>.
<item> Multi-paramter type classes. We have relaxed some of the rules
since GHC 3.00. In particular
<descrip>
<tag><tt>-fallow-overlapping-instances</tt></tag>
allows overlapping instances
<tag><tt>-fallow-undecidable-instances</tt></tag>
allows you to write instance contexts that constrain non-type-variables
</descrip>
Full details in Section <ref name="Multi-parameter type classes"
id="multi-param-type-classes">.
</itemize>
<sect2>New Libraries
<p>
Documentation in <url name="GHC/Hugs Extension Libraries"
url="libs.html">.
<descrip>
<tag><tt>Dynamic</tt></tag>
Dynamic types.
<tag><tt>Exceptions</tt></tag>
The library <tt>Exception</tt> in <tt>-syslib exts</tt> provide an interface for
exception handling. Calls to <tt>error</tt>, pattern matching failures and a
bunch of other exception can be caught.
</descrip>
<sect2>Compiler internals
<p>
The intermediate language used by GHC has had a radical overhaul.
The new Core language (coreSyn/CoreSyn.lhs) is much smaller and
more uniform. The main transformation engine (the "simplifier")
has been totally rewritten. The compiler is several thousand lines
shorter as a result. It's also very much easier to understand
and modify. (It's true. Honest!)
<sect2>Run time system
<p>
There is a completely new runtime system, aimed at integration with
Hugs. Tons of cruft removed. Some changes to code generation; things
typically run a bit faster as a result.
An overview of the new RTS is available: <url name="The New GHC/Hugs
Runtime System" url="http://www.dcs.gla.ac.uk/~simonm/rts.ps">.
<sect2>Storage Manager/Garbage Collector
<p>
The new storage manager features a dynamically resizing heap, so you
won't need those pesky <tt>-H</tt> options anymore. In fact, the <tt>-H</tt> option
is now ignored for compatibility with older versions.
Stacks are now also expandable, and the <tt>-K</tt> option now specifies a
<em/maximum/ heap size. The default is (a perhaps conservative) <tt>1M</tt>.
The garbage collector now collects CAFs, so there's no more space
leaks associated with these. If you think you have a CAF-related
space leak, we'd like to hear about it.
The storage manager current only has a two-space garbage collector,
which will be slower than 3.02's generational collector when the
amount of live data is large. A new generational collector is high on
our priority list.
For the other new tweakables, see Section <ref name="RTS options to
control the garbage-collector" id="rts-options-gc">.
<sect2>Profiling
<p>
There is a new profiler based on <em/Cost Centre Stacks/. This is an
extension of the previous cost centre scheme, whereby the profilier
stores information about the call-graph of the program and attributes
costs to nodes of this graph.
For a quick demo, try compiling a program with <tt>-prof -auto-all</tt>, then
run it with <tt>+RTS -p</tt> and see what comes out (in the <tt>&lt;prog&gt;.prof</tt>
file).
The feature is still experimental, and the call graph may not be
exactly what you were expecting. Also, we only have time/allocation
profiling at the moment; heap profiling will follow shortly.
<sect2>Miscellaneous
<p>
<itemize>
<item> Concurrent Haskell is now the default. No need to
compile/download special libraries. The context switch interval isn't
tweakable any more; threads just yield after allocating a fixed amount
of heap (currently 4k). If you want a quicker context switch, that
won't be possible: this decision was made for efficiency reasons (it
reduces the penalty for runnning threaded code to almost zero). We
might allow the context switch interval to be increased in the future;
but also context switches are pretty fast (faster than before).
<item> <tt>forkIO</tt> now returns a <tt>ThreadId</tt>, and there's a new operation
<tt>killThread</tt> which will terminate an existing thread. See Section
<ref name="The Concurrent interface" id="concurrent-interface"> for
more details.
<item> You need <tt>-syslib concurrent</tt> to get the <tt>Concurrent</tt> library.
<item> The rewritten IO library from 3.03 has been ported to 4.00.
<item> New constructs: <tt>foriegn import</tt> and <tt>foreign export</tt> for
H/Direct.
<item> Supported architectures: all the development has been done on
x86(mainly FreeBSD/Linux) so this is the most stable environment.
Sparc (Solaris) and x86/Win32 (cygwin32) have also been mildly tested, and
an Alpha port is in the works. Everything else will need a little
porting effort; we don't have machines here, so any help would be
greatly appreciated.
<item> Code is faster and smaller, but programs might run slower due
to the garbage collector (see "Storage Manager" above). Increasing
the minimum allocation area with the <tt>-A</tt> RTS option can claw back
some of this speed.
<item> We now use GMP 2.02, and attempt to use an already-installed
copy if available. If you have GMP on your system but the configure
script doesn't detect it, we'd like to know.
<item> <tt>seq</tt> works better than in 3.xx - you can now <tt>seq</tt> functions
without crashing the program.
<item> The <tt>Eval</tt> class has been removed (i.e. every type is assumed
to be in class <tt>Eval</tt>). This change has been made in anticipation of
Haskell 98.
<item> The native code generator has had very little testing (it's not used
on x86 yet), so Sparcs may have some trouble with it. Try -fvia-C if
strange errors occur.
<item> The compiler is slightly faster, but sometimes needs more heap.
If you have an example where this is the case, please let us know.
</itemize>
<sect1>Release notes for version~4.01---11/98
<label id="release-4-01">
<p>
<itemize>
<item> <tt/relocate_TSO/ bug fixed.
<item> Weak pointers implemented, and new <tt/Weak/ library provided
(see <htmlurl name="GHC/Hugs Extension Libraries" url="libs.html">).
The <tt/ForeignObj/ interface no longer supports finalisation - use
the <tt/Weak/ interface for that.
<item> Foreign funcion interface is now complete and working.
<item> New interface file format for compatibility with Hugs. No
user-visible changes except that you'll have to update any .hi-boot
files you have lying around - check out some GHC-generated .hi files
for examples.
<item> Space leak in the compiler is partially fixed -
<tt/-dcore-lint/ is still recommended for decent space behaviour.
<item> New API to the RTS (not interesting unless you're an RTS client
writer).
<item> <tt/thawIOArray/ added to <tt/IOExts/.
<item> Many many small bugs fixed.
</itemize>
<sect1>Release notes for version~4.02---12/98
<label id="release-4-02">
<p>
<itemize>
<item> Full Haskell 98 language support.
<item> Scoped type variables implemented (see Section <ref
name="Scoped Type Variables" id="scoped-type-variables">).
<item> Several bugs in _ccall_GC and foreign export fixed.
<item> Warnings for unused variables should work now (they didn't before).
<item> Simplifier improvements:
<itemize>
<item> Much better treatment of strict arguments.
<item> Function arguments of unlifted type are treated as strict.
<item> Better treatment of bottoming Ids.
<item> No need for worker/wrapper split for fns that are merely strict.
<item> Fewer iterations needed, I hope.
</itemize>
<item> Strictness of primitive operations is now explicit and used by
the simplifier.
<item> Less gratuitous renaming in interface files and abs C.
<item> <tt/OccName/ is a separate module, and is an abstract data type.
<item> A new generational garbage collector: the number of generations
is variable, using the -G RTS option (see <ref id="rts-options-gc"
name="RTS options to control the garbage-collector">). This collector
is faster and more space-efficient than the two-space collector in 4.01.
<item> Error messages and warnings are now printed out in the order they
occur in the source code.
<item> <tt/isEmptyMVar/ operation added to the <tt/Concurrent/ library.
<item> Two new functions exported from <tt/ST/ (and <tt/LazyST/):
<tt/unsafeIOToST/ and <tt/stToIO/.
<item> The <tt/+RTS -H&lt;size&gt;/ option is reinstated. Now it
means "use about this much memory" (see Section <ref
id="rts-options-gc" name="RTS options to control the garbage
collector">). This option was added mainly so that 4.02 GC times look
good compared to 3.02 :-).
<item> <tt/finalise/ and <tt/mkWeakNoFinaliser/ operations added to
<tt/Weak/ library.
<item> Ticky-ticky profiling works again (cost-centre profiling is
still broken).
<item> Better <tt/egcs-1.1.1/ support.
</itemize>
<sect1>Release notes for version~4.03---3/99
<label id="release-4-03">
<p>
<itemize>
<item> <tt/Weak/ library changes:
<itemize>
<item> Finalise is now spelt finalize in all function names.
<item> <tt/finalize/ now runs the finalizer immediately, and
waits for it to complete before returning.
<item> <tt/mkWeak/ now takes a <tt/Maybe (IO ())/ for the finalizer,
and <tt/mkWeakNoFinalizer/ is removed.
</itemize>
<item> Changed representation of <tt/Integer/ type to speed up
computations on small integers. The performance of <tt/Integer/ is now
only slightly slower than <tt/Int/ for values between <tt/minBound :: Int/
and <tt/maxBound :: Int/.
<item> On Win32 platforms, added support for using (and producing) dynamic
link libraries (DLLs) containing ghc-compiled code.
<item> Added <tt>-funbox-strict-fields</tt> for unboxing/unpacking strict
constructor fields.
</itemize>
<Sect1 id="release-4-04">
<Title>Release notes for version&nbsp;4.04&mdash;7/99
</Title>
<Para>
<ItemizedList>
<ListItem>
<Para>
<Literal>Weak</Literal> library changes:
<ItemizedList>
<ListItem>
<Para>
Finalise is now spelt finalize in all function names.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>finalize</Literal> now runs the finalizer immediately, and
waits for it to complete before returning.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>mkWeak</Literal> now takes a <Literal>Maybe (IO ())</Literal> for the finalizer,
and <Literal>mkWeakNoFinalizer</Literal> is removed.
</Para>
</ListItem>
<ListItem>
<Para>
A weak pointer whose key is itself a weak pointer will now do the right
thing.
</Para>
</ListItem>
</ItemizedList>
</Para>
</ListItem>
<ListItem>
<Para>
Changed representation of <Literal>Integer</Literal> type to speed up
computations on small integers. The performance of <Literal>Integer</Literal> is now
only slightly slower than <Literal>Int</Literal> for values between <Literal>minBound::Int</Literal>
and <Literal>maxBound::Int</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
On Win32 platforms, added support for using (and producing) dynamic
link libraries (DLLs) containing ghc-compiled code.
</Para>
</ListItem>
<ListItem>
<Para>
Added <Literal>-funbox-strict-fields</Literal> for unboxing/unpacking strict
constructor fields.
</Para>
</ListItem>
<ListItem>
<Para>
GHC now has a license! Check out <Literal>fptools/ghc/LICENSE/</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
Added CPR analysis, which reduces allocation by unboxing function results
(thanks to Kevin Glynn <Literal>&lt;keving@cs.mu.OZ.AU&gt;</Literal>).
</Para>
</ListItem>
<ListItem>
<Para>
UsageSP analysis added, but not yet functional.
</Para>
</ListItem>
<ListItem>
<Para>
Added a simple common sub-expression analysis pass.
</Para>
</ListItem>
<ListItem>
<Para>
Implemented update-in-place for certain very restricted cases.
</Para>
</ListItem>
<ListItem>
<Para>
Replaced GHC's old and worn yacc/lex parser with a new one based on Happy.
Fixed several Haskell 98 non-conformance issues in the process.
</Para>
</ListItem>
<ListItem>
<Para>
Added <Literal>Concurrent.yield :: IO ()</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
Added RULES pragms&mdash;transformation rules for Haskell source.
This is used for list fusion: now intermediate lists between map,
foldr, list comprehensions are removed automatically.
</Para>
</ListItem>
<ListItem>
<Para>
Unregisterised/unmangled builds now work.
</Para>
</ListItem>
<ListItem>
<Para>
Much performance tuning: GHC 4.04 produces faster code than all previous
compilers.
</Para>
</ListItem>
<ListItem>
<Para>
GHC now defines <Literal>&lowbar;&lowbar;HASKELL98&lowbar;&lowbar;</Literal> when compiling files with <Literal>-cpp</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>hppa1.1-hp-hpux</Literal> port reinstated.
</Para>
</ListItem>
<ListItem>
<Para>
New operations for unsafely thawing byte arrays:
<Literal>unsafeThaw&lcub;Byte,ST,IO&rcub;Array</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>mkdependHS</Literal> now lives in GHC's lib directory, not the
binary directory. It isn't intended to be run standalone, only via
<Literal>ghc -M</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
Asynchronous exceptions are now supported (see <XRef LinkEnd="concurrent-interface">). New operations:
<ItemizedList>
<ListItem>
<Para>
<Literal>Exception.killThread</Literal> now raises an exception
(<Literal>AsyncException.KilledThread</Literal>) in the killed thread.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>Exception.raiseInThread</Literal> allows a thread to raise an
exception in another thread.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>Concurrent.myThreadId</Literal> returns the <Literal>ThreadId</Literal> of the calling thread.
</Para>
</ListItem>
<ListItem>
<Para>
Stack overflow results in <Literal>AsyncException.StackOverflow</Literal>
being raised in the offending thread.
</Para>
</ListItem>
</ItemizedList>
</Para>
</ListItem>
<ListItem>
<Para>
Assertion failures now raise an <Literal>AssertionFailed</Literal> exception.
</Para>
</ListItem>
<ListItem>
<Para>
Added simple high-level interface to the Regex library, see <XRef LinkEnd="RegexString">.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>forkIO</Literal> now handles any uncaught exceptions cleanly.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>integer2Int&num;</Literal> isn't sign preserving any longer, but modulo <Literal>(maxBound::Int + 1) * 2</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
<Literal>-ddump-rdr</Literal> is now called <Literal>-ddump-parsed</Literal>.
</Para>
</ListItem>
<ListItem>
<Para>
Signal handling with the <Literal>Posix</Literal> library now works.
</Para>
</ListItem>
<ListItem>
<Para>
Many, many bugs fixed.
</Para>
</ListItem>
</ItemizedList>
</Para>
</Sect1>
<Sect1 id="options-debugging">
<Title>Debugging the compiler
</Title>
<Para>
<IndexTerm><Primary>debugging options (for GHC)</Primary></IndexTerm>
</Para>
<Para>
HACKER TERRITORY. HACKER TERRITORY.
(You were warned.)
</Para>
<Sect2 id="replacing-phases">
<Title>Replacing the program for one or more phases.
</Title>
<Para>
<IndexTerm><Primary>GHC phases, changing</Primary></IndexTerm>
<IndexTerm><Primary>phases, changing GHC</Primary></IndexTerm>
You may specify that a different program be used for one of the phases
of the compilation system, in place of whatever the driver <Literal>ghc</Literal> has
wired into it. For example, you might want to try a different
assembler. The
<Literal>-pgm&lt;phase-code&gt;&lt;program-name&gt;</Literal><IndexTerm><Primary>-pgm&lt;phase&gt;&lt;stuff&gt;
option</Primary></IndexTerm> option to <Literal>ghc</Literal> will cause it to use <Literal>&lt;program-name&gt;</Literal>
for phase <Literal>&lt;phase-code&gt;</Literal>, where the codes to indicate the phases are:
</Para>
<Para>
<InformalTable>
<TGroup Cols="2">
<ColSpec Align="Left" Colsep="0">
<ColSpec Align="Left" Colsep="0">
<TBody>
<Row>
<Entry><Emphasis>code</Emphasis> </Entry>
<Entry><Emphasis>phase</Emphasis> </Entry>
</Row>
<Row>
<Entry>
L </Entry>
<Entry> literate pre-processor </Entry>
</Row>
<Row>
<Entry>
P </Entry>
<Entry> C pre-processor (if -cpp only) </Entry>
</Row>
<Row>
<Entry>
C </Entry>
<Entry> Haskell compiler </Entry>
</Row>
<Row>
<Entry>
c </Entry>
<Entry> C compiler</Entry>
</Row>
<Row>
<Entry>
a </Entry>
<Entry> assembler </Entry>
</Row>
<Row>
<Entry>
l </Entry>
<Entry> linker </Entry>
</Row>
<Row>
<Entry>
dep </Entry>
<Entry> Makefile dependency generator </Entry>
</Row>
</TBody>
</TGroup>
</InformalTable>
</Para>
</Sect2>
<Sect2 id="forcing-options-through">
<Title>Forcing options to a particular phase.
</Title>
<Para>
<IndexTerm><Primary>forcing GHC-phase options</Primary></IndexTerm>
</Para>
<Para>
The preceding sections describe driver options that are mostly
applicable to one particular phase. You may also <Emphasis>force</Emphasis> a
specific option <Literal>&lt;option&gt;</Literal> to be passed to a particular phase
<Literal>&lt;phase-code&gt;</Literal> by feeding the driver the option
<Literal>-opt&lt;phase-code&gt;&lt;option&gt;</Literal>.<IndexTerm><Primary>-opt&lt;phase&gt;&lt;stuff&gt;
option</Primary></IndexTerm> The codes to indicate the phases are the same as in the
previous section.
</Para>
<Para>
So, for example, to force an <Literal>-Ewurble</Literal> option to the assembler, you
would tell the driver <Literal>-opta-Ewurble</Literal> (the dash before the E is
required).
</Para>