Commit a7e6cdbf authored by partain's avatar partain

[project @ 1996-06-27 15:55:53 by partain]

partain 1.3 changes to 960626
parent 26741ec4
The Glasgow Haskell Compiler -- version 2.01
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We are proud to announce the first public release of the Glasgow
Haskell Compiler (GHC) for the revised Haskell 1.3 language. Sources
and binaries are freely available by anonymous FTP and on the
World-Wide Web; details below.
GHC 2.01 is a test-quality release, worth trying if you are a gung-ho
Haskell user or if you want to ensure that we quickly fix bugs that
affect your programs :-) We advise *AGAINST* deleting your copy of
that old workhorse GHC 0.26 (for Haskell 1.2), and *AGAINST* relying
on this compiler (2.01) in any way. With your help in testing 2.01,
we hope to release a more solid Haskell 1.3 compiler relatively soon.
Haskell is "the" standard lazy functional programming language [see
SIGPLAN Notices, May 1992]. The current language version is 1.3,
agreed in May, 1996.
The Glasgow Haskell project seeks to bring the power and elegance of
functional programming to bear on real-world problems. To that end,
GHC lets you call C (including cross-system garbage collection),
provides good profiling tools, supports ever richer I/O, and
concurrency and parallelism. Our goal is to make it the "tool of
choice for real-world applications".
GHC 2.01 is quite different from 0.26 (July 1995), as the new version
number suggests. (The 1.xx numbers are reserved for any Haskell-1.2
compiler releases.) Changes worth noting include:
.......
* Concurrent Haskell: with this, you can build programs out of many
I/O-performing, interacting `threads'. We have a draft paper
about Concurrent Haskell, and our forthcoming Haggis GUI toolkit
uses it.
* Parallel Haskell, running on top of PVM (Parallel Virtual Machine)
and hence portable to pretty much any parallel architecture,
whether shared memory or distributed memory. With this, your
Haskell program runs on multiple processors, guided by `par` and
`seq` annotations. The first pretty-much-everyone-can-try-it
parallel functional programming system! NB: The parallel stuff is
"research-tool quality"... consider this an alpha release.
* "Foldr/build" deforestation (by Andy Gill) is in, as are
"SPECIALIZE instance" pragmas (by Patrick Sansom).
* The LibPosix library provides an even richer I/O interface than
the standard 1.3 I/O library. A program like a shell or an FTP
client can be written in Haskell -- examples included.
* Yet more cool libraries: Readline (GNU command-line editing),
Socket (BSD sockets), Regex and MatchPS (GNU regular expressions).
By Darren Moffat and Sigbjorn Finne.
* New ports -- Linux (a.out) and MIPS (Silicon Graphics).
* NB: configuration has changed yet again -- for the better, of
course :-)
Please see the release notes for a complete discussion of What's New.
To run this release, you need a machine with 16+MB memory, GNU C
(`gcc'), and `perl'. We have seen GHC 0.26 work on these platforms:
alpha-dec-osf2, hppa1.1-hp-hpux9, i386-unknown-linuxaout,
m68k-sun-sunos4, mips-sgi-irix5, and sparc-sun-{sunos4,solaris2}.
Similar platforms should work with minimal hacking effort.
The installer's guide give a full what-ports-work report.
Binaries are now distributed in `bundles', e.g. a "profiling bundle"
or a "concurrency bundle" for your platform. Just grab the ones you
need.
Once you have the distribution, please follow the pointers in
ghc/README to find all of the documentation about this release. NB:
preserve modification times when un-tarring the files (no `m' option
for tar, please)!
We run mailing lists for GHC users and bug reports; to subscribe, send
mail to glasgow-haskell-{users,bugs}-request@dcs.glasgow.ac.uk.
Please send bug reports to glasgow-haskell-bugs.
Particular thanks to: Jim Mattson (author of much of the code) who has
now moved to HP in California; and the Turing Institute who donated a
lot of SGI cycles for the SGI port.
Simon Peyton Jones and Will Partain
Dated: 95/07/24
Relevant URLs on the World-Wide Web:
GHC home page http://www.dcs.glasgow.ac.uk/fp/software/ghc.html
Glasgow FP group page http://www.dcs.glasgow.ac.uk/fp/
comp.lang.functional FAQ http://www.cs.nott.ac.uk/Department/Staff/mpj/faq.html
======================================================================
How to get GHC 0.26:
This release is available by anonymous FTP from the main Haskell
archive sites, in the directory pub/haskell/glasgow:
ftp.dcs.glasgow.ac.uk (130.209.240.50)
ftp.cs.chalmers.se (129.16.227.140)
haskell.cs.yale.edu (128.36.11.43)
The Glasgow site is mirrored by src.doc.ic.ac.uk (146.169.43.1), in
computing/programming/languages/haskell/glasgow.
These are the available files (.gz files are gzipped) -- some are `on
demand', ask if you don't see them:
ghc-0.26-src.tar.gz The source distribution; about 3MB.
ghc-0.26.ANNOUNCE This file.
ghc-0.26.{README,RELEASE-NOTES} From the distribution; for those who
want to peek before FTPing...
ghc-0.26-ps-docs.tar.gz Main GHC documents in PostScript format; in
case your TeX setup doesn't agree with our
DVI files...
ghc-0.26-<platform>.tar.gz Basic binary distribution for a particular
<platform>. Unpack and go: you can compile
and run Haskell programs with nothing but one
of these files. NB: does *not* include
profiling (see below).
<platform> ==> alpha-dec-osf2
hppa1.1-hp-hpux9
i386-unknown-linuxaout
i386-unknown-solaris2
m68k-sun-sunos4
mips-sgi-irix5
sparc-sun-sunos4
sparc-sun-solaris2
ghc-0.26-<bundle>-<platform>.tar.gz
<platform> ==> as above
<bundle> ==> prof (profiling)
conc (concurrent Haskell)
par (parallel)
gran (GranSim parallel simulator)
ticky (`ticky-ticky' counts -- for implementors)
prof-conc (profiling for "conc[urrent]")
prof-ticky (ticky for "conc[urrent]")
ghc-0.26-hc-files.tar.gz Basic set of intermediate C (.hc) files for the
compiler proper, the prelude, and `Hello,
world'. Used for bootstrapping the system.
About 4MB.
ghc-0.26-<bundle>-hc-files.tar.gz Further sets of .hc files, for
building other "bundles", e.g., profiling.
ghc-0.26-hi-files-<blah>.tar.gz Sometimes it's more convenient to
use a different set of interface files than
the ones in *-src.tar.gz. (The installation
guide will advise you of this.)
We could provide diffs from previous versions of GHC, should you
require them. A full set would be very large (7MB).
......@@ -31,6 +31,6 @@ Makefile: Makefile.in config.status
config.status: configure
$(SHELL) config.status --recheck
configure: configure.in
cd $(srcdir); autoconf < configure.in > configure.new
cd $(srcdir) && autoconf < configure.in > configure.new
grep -v '# Generated automatically from' < configure.new > configure
......@@ -30,15 +30,15 @@ esac
for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
make -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
make Makefile ; \
make Makefiles \
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
@MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
@MakeCmd@ Makefile ; \
@MakeCmd@ Makefiles \
)
else
echo warning: $i is not a directory -- doing nothing for it
......@@ -49,14 +49,14 @@ done
for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
make depend ; \
echo '' ; \
echo "*** making all in $i ..." ; \
make all \
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
@MakeCmd@ depend ; \
echo '' ; \
echo "*** making all in $i ..." ; \
@MakeCmd@ all \
)
else
echo warning: $i is not a directory -- doing nothing for it
......@@ -67,22 +67,22 @@ done
passed_in_setup="-S @MkWorldSetup@"
for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ $i = nofib ] ; then
setup=$passed_in_setup
else
setup=''
fi
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
make -f Makefile.BOOT BOOT_DEFINES="-P $i $setup -C mkworld -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
make Makefile ; \
make Makefiles \
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
@MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P $i $setup -C mkworld -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
@MakeCmd@ Makefile ; \
@MakeCmd@ Makefiles \
)
else
if [ $i != EndOfList ] ; then
......@@ -93,13 +93,13 @@ done
# Finally, the dependencies
for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
make depend \
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
@MakeCmd@ depend \
)
else
if [ $i != EndOfList ] ; then
......@@ -112,7 +112,7 @@ echo ''
echo '*******************************************************************'
echo "* Looking good! All you should need to do now is... *"
echo '* *'
for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ $i != EndOfList ] ; then
echo " cd $i"
if [ $i = nofib ] ; then
......
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
......@@ -51,14 +51,21 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:V*:*)
alpha:OSF1:[VX]*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
# After 4.x, OSF1 uses "X4.x" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'`
exit 0 ;;
alpha:OSF1:*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
......@@ -111,9 +118,15 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
mips:*:4*:UMIPS)
echo mips-mips-riscos4sysv
exit 0 ;;
mips:*:5*:RISCos)
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
......@@ -124,12 +137,17 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
......@@ -181,10 +199,8 @@ EOF
else
IBM_ARCH=powerpc
fi
if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1
elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1.1
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
fi
......@@ -215,7 +231,7 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
......@@ -251,13 +267,13 @@ EOF
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
......@@ -308,19 +324,38 @@ EOF
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo i386-unknown-cygwin32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# Systems without a BFD linker
if test -d /usr/lib/ldscripts/. ; then
:
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux ; exit 0
else
echo "${UNAME_MACHINE}-unknown-linuxoldld"
exit 0
fi
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
# Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linuxoldld and linuxaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
......@@ -333,8 +368,9 @@ char *argv[];
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy;;
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i[34]86:DYNIX/ptx:4*:*)
......@@ -354,6 +390,8 @@ EOF
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv32
......@@ -384,19 +422,19 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m680[234]0:LynxOS:2.2*:*)
m680[234]0:LynxOS:2.[23]*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i[34]86:LynxOS:2.2*:*)
i[34]86:LynxOS:2.[23]*:*)
echo i386-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.2*:*)
TSUNAMI:LynxOS:2.[23]*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.2*:*)
rs6000:LynxOS:2.[23]*:*)
echo rs6000-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
RM*:SINIX-*:*:*)
......@@ -410,12 +448,26 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
R3000:*System_V*:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
......@@ -479,7 +531,18 @@ main ()
#endif
#if defined (_SEQUENT_)
printf ("i386-sequent-ptx\n"); exit (0);
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
......
This diff is collapsed.
This diff is collapsed.
#define IHaveSubdirs
MsubNeededHere( ./glue_TAGS_files )
/* order in SUBDIRS is not supposed to be important but ...
"compiler" must be before "lib", because we use
the compiler just built to compile pieces of "lib".
......@@ -38,10 +36,3 @@ SUBDIRS = includes \
whoami::
@echo using a \`$(BUILDPLATFORM)\' host to build a Haskell compiler to run on a
@echo \`$(HOSTPLATFORM)\' host that will generate \`C\' target code
fulltags : ./glue_TAGS_files
$(RM) ./TAGS
./glue_TAGS_files `find . -type f -name TAGS -print`
/* this line makes sure perl gets picked up from the right place */
MsubProgramScriptTarget(PerlCmd,./glue_TAGS_files,./glue_TAGS_files.prl,,)
......@@ -40,7 +40,7 @@ JMAKE_CMD = $(NEWTOP)$(JMAKE) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) -DTopDir
Makefile:: $(JMAKE)
$(JMAKE):
@(cd $(JMAKESRC); if [ -f Makefile ]; then \
@(cd $(JMAKESRC) && if [ -f Makefile ]; then \
echo "checking $@ in $(JMAKESRC) first..."; $(MAKE) all; else \
echo "bootstrapping $@ from Makefile.BOOT in $(JMAKESRC) first..."; \
$(MAKE) -f Makefile.BOOT BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
......
The Glamorous Glasgow Haskell Compiler, version 0.27, patchlevel 0
The Glamorous Glasgow Haskell Compiler, version 2.01, patchlevel 0
(for Haskell 1.3)
This is version 0.26 of the Glorious Glasgow Haskell compilation
This is version 2.01 of the Glorious Glasgow Haskell compilation
system (GHC). This is a major public release. The top-level file
"ANNOUNCE-0.26" says more.
"ANNOUNCE-0.28" says more.
Haskell is "the" standard lazy functional programming language [see
SIGPLAN Notices, May 1992]. Some general merits of GHC are given at
......
......@@ -2,6 +2,7 @@
/* just documents here */
#define NoAllTargetForSubdirs
#define NoDependTargetForSubdirs
#define NoRunTestsTargetForSubdirs
#define NoInstallTargetForSubdirs
#define NoTagTargetForSubdirs
......
%
% $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/docs/install_guide/Attic/installing.lit,v 1.1 1996/01/08 20:25:19 partain Exp $
% $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/docs/install_guide/Attic/installing.lit,v 1.2 1996/06/27 15:57:32 partain Exp $
%
\begin{onlystandalone}
\documentstyle[11pt,literate]{article}
......@@ -12,7 +12,7 @@ University of Glasgow\\
Glasgow, Scotland\\
G12 8QQ\\
\\
Email: glasgow-haskell-\{request,bugs\}\@dcs.glasgow.ac.uk}
Email: glasgow-haskell-\{users,bugs\}-request\@dcs.glasgow.ac.uk}
\maketitle
\begin{rawlatex}
\tableofcontents
......
......@@ -8,7 +8,7 @@ University of Glasgow\\
Glasgow, Scotland\\
G12 8QQ\\
\\
Email: glasgow-haskell-\{bugs,request\}\@dcs.glasgow.ac.uk}
Email: glasgow-haskell-\{users,bugs\}-request\@dcs.glasgow.ac.uk}
\maketitle
\begin{rawlatex}
\tableofcontents
......
......@@ -349,8 +349,8 @@ data StateAndFloat# s = StateAndFloat# (State# s) Float#
data StateAndDouble# s = StateAndDouble# (State# s) Double#
data StateAndAddr# s = StateAndAddr# (State# s) Addr#
data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
data StateAndMallocPtr# s = StateAndMallocPtr# (State# s) MallocPtr#
data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
data StateAndForeignObj# s = StateAndForeignObj# (State# s) ForeignObj#
data StateAndSynchVar# s a = StateAndSynchVar# (State# s) (SynchVar# a)
data StateAndArray# s elt = StateAndArray# (State# s) (Array# elt)
......@@ -461,47 +461,68 @@ deRefStablePointer# :: StablePtr# a -> State# _RealWorld -> StateAndPtr _RealWor
@
There is also a C procedure @FreeStablePtr@ which frees a stable pointer.
\subsubsection{``Malloc'' pointers}
%
% Rewritten and updated for MallocPtr++ -- 4/96 SOF
%
\subsubsection{Foreign objects}
A ``malloc'' pointer is an ordinary pointer from outside the Haskell world
(i.e., from the C world) where the Haskell world has been told ``Let me
A \tr{ForeignObj} is a reference to an object outside the Haskell
world (i.e., from the C world, or a reference to an object on another
machine completely.), where the Haskell world has been told ``Let me
know when you're finished with this ...''.
The ``malloc'' pointer type is just a special @Addr#@ ({\em not} parameterised).
The \tr{ForeignObj} type is just a special @Addr#@ ({\em not} parameterised).
@
type MallocPtr#
type ForeignObj#
@
{\em ToDo: say more about this and how it's used...}
The main point is that when Haskell discards a
value of type @MallocPtr#@, it calls the procedure @FreeMallocPtr@, which
must be provided by the C world. @FreeMallocPtr@ might in turn call
the GHC-provided procedure @FreeStablePtr@, to deallocate a stable pointer.
No other GHC runtime system procedures should be called by @FreeMallocPtr@.
A typical use of \tr{ForeignObj} is in constructing Haskell bindings
to external libraries. A good example is that of writing a binding to
an image-processing library (which was actually the main motivation
for implementing \tr{ForeignObj}'s precursor, \tr{MallocPtr}). The
images manipulated are not stored in the Haskell heap, either because
the library insist on allocating them internally or we (sensibly)
decide to spare the GC from having to heave heavy images around.
(Implementation: a linked list of all @MallocPtr#@s is maintained to allow the
garbage collector to detect when a @MallocPtr#@ becomes garbage.)
@
data Image = Image ForeignObj#
Like @Array@, @MallocPtr#@s are represented by heap objects.
instance _CCallable Image
@
{\bf ToDo --- Important:} Ian Poole reports a need for functions to return a list of
CHPs. Should we add a @CHeapPtrArray@ type too? or just
hack something up?
The \tr{ForeignObj#} type is then used to refer to the externally
allocated image, and to acheive some type safety, the Haskell binding
defines the @Image@ data type. So, a value of type \tr{ForeignObj#} is
used to ``box'' up an external reference into a Haskell heap object
that we can then indirectly reference:
The only Haskell operation we might want on @MallocPtr#@s is an
equality test. However, this is easily implemented if desired:
@
> eqCHP x y = (_runST (_ccall_ equal x y) == 1::Int)
createImage :: (Int,Int) -> PrimIO Image
@
So far, this looks just like an @Addr#@ type, but \tr{ForeignObj#}
offers a bit more, namely that we can specify a {\em finalisation
routine} to invoke when the \tr{ForeignObj#} is discarded by the
GC. The garbage collector invokes the finalisation routine associated
with the \tr{ForeignObj#}, saying `` Thanks, I'm through with this
now..'' For the image-processing library, the finalisation routine could for
the images free up memory allocated for them. The finalisation routine has
currently to be written in C (the finalisation routine can in turn call on
@FreeStablePtr@ to deallocate a stable pointer.).
C> equal (x, y)
C> {
C> return (x == y ? 1 : 0);
C> }
Associating a finalisation routine with an external object is done by
\tr{makeForeignObj#}:
@
makeForeignObj# :: Addr# -- foreign reference
-> Addr# -- pointer to finalisation routine
-> StateAndForeignObj# _RealWorld ForeignObj#
@
The C world must provide a function @FreeCHeapPointer@ which
will be called (with a C Heap pointer as argument) when the garbage
collector releases a CHP.
(Implementation: a linked list of all @ForeignObj#@s is maintained to allow the
garbage collector to detect when a @ForeignObj#@ becomes garbage.)
Like @Array@, @ForeignObj#@s are represented by heap objects.
{\bf ToDo:} Decide whether @FreeCHeapPointer@ is allowed to call on a
stable pointer. (I sincerely hope not since we will still be in the
......@@ -803,14 +824,14 @@ writeCharArray :: Ix ix => _MutableByteArray s ix -> ix -> Char -> _ST s ()
@
freezeArray :: Ix ix => _MutableArray s ix elt -> _ST s (Array ix elt)
freezeCharArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix Char)
freezeCharArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
...
@
We have no need on one-function-per-type for unsafe freezing:
@
unsafeFreezeArray :: Ix ix => _MutableArray s ix elt -> _ST s (Array ix elt)
unsafeFreezeByteArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix elt)
unsafeFreezeByteArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
@
Sometimes we want to snaffle the bounds of one of these beasts:
......@@ -854,11 +875,13 @@ makeStablePointer :: a -> _StablePtr a
freeStablePointer :: _StablePtr a -> PrimIO ()
@
\subsection{``Malloc'' pointers}
\subsection{Foreign objects}
Again, just boxing up.
@
data _MallocPtr = _MallocPtr MallocPtr#
data _ForeignObj = _ForeignObj ForeignObj#
makeForeignObj :: _Addr -> _Addr -> PrimIO _ForeignObj
@