ghc-hetmet.git
20 years ago[project @ 2003-09-29 10:49:59 by simonmar]
simonmar [Mon, 29 Sep 2003 10:49:59 +0000 (10:49 +0000)]
[project @ 2003-09-29 10:49:59 by simonmar]
Uncomment Alex version test: Alex 2.0 is now required to build GHC.

20 years ago[project @ 2003-09-28 19:44:14 by wolfgang]
wolfgang [Sun, 28 Sep 2003 19:44:15 +0000 (19:44 +0000)]
[project @ 2003-09-28 19:44:14 by wolfgang]
More Mac OS X-specific gcc 3.3 fixes

merge to stable

20 years ago[project @ 2003-09-26 13:32:14 by panne]
panne [Fri, 26 Sep 2003 13:32:14 +0000 (13:32 +0000)]
[project @ 2003-09-26 13:32:14 by panne]
Warning police

20 years ago[project @ 2003-09-26 12:12:35 by panne]
panne [Fri, 26 Sep 2003 12:12:35 +0000 (12:12 +0000)]
[project @ 2003-09-26 12:12:35 by panne]
Warning police

20 years ago[project @ 2003-09-26 12:11:18 by panne]
panne [Fri, 26 Sep 2003 12:11:18 +0000 (12:11 +0000)]
[project @ 2003-09-26 12:11:18 by panne]
Added prototypes for __hscore_[gs]et_saved_termios to make Linker.c
happy and avoid warnings in RtsStartup.c

20 years ago[project @ 2003-09-26 09:26:12 by panne]
panne [Fri, 26 Sep 2003 09:26:13 +0000 (09:26 +0000)]
[project @ 2003-09-26 09:26:12 by panne]
Saving/restoring termios is only done for GHC

20 years ago[project @ 2003-09-26 09:17:28 by simonmar]
simonmar [Fri, 26 Sep 2003 09:17:28 +0000 (09:17 +0000)]
[project @ 2003-09-26 09:17:28 by simonmar]
Update Linker following changes to saved_termios.

20 years ago[project @ 2003-09-26 09:01:08 by simonpj]
simonpj [Fri, 26 Sep 2003 09:01:08 +0000 (09:01 +0000)]
[project @ 2003-09-26 09:01:08 by simonpj]
Better error trace when cat_evals crashes

20 years ago[project @ 2003-09-25 15:14:41 by panne]
panne [Thu, 25 Sep 2003 15:14:44 +0000 (15:14 +0000)]
[project @ 2003-09-25 15:14:41 by panne]
To fix dynamic linking issues with Hugs, access saved_termios via
getter/setter.

20 years ago[project @ 2003-09-25 09:19:23 by simonmar]
simonmar [Thu, 25 Sep 2003 09:19:23 +0000 (09:19 +0000)]
[project @ 2003-09-25 09:19:23 by simonmar]
Add saved_termios symbol

20 years ago[project @ 2003-09-24 13:20:03 by simonmar]
simonmar [Wed, 24 Sep 2003 13:20:03 +0000 (13:20 +0000)]
[project @ 2003-09-24 13:20:03 by simonmar]
remove docs for -fwith option

20 years ago[project @ 2003-09-24 13:04:45 by simonmar]
simonmar [Wed, 24 Sep 2003 13:04:58 +0000 (13:04 +0000)]
[project @ 2003-09-24 13:04:45 by simonmar]
The concensus seems to be that 'with' should go away now, after its
customary period of deprecation.  Hugs has already removed it, so
we're following suit.

20 years ago[project @ 2003-09-24 11:06:51 by simonmar]
simonmar [Wed, 24 Sep 2003 11:06:54 +0000 (11:06 +0000)]
[project @ 2003-09-24 11:06:51 by simonmar]
Move forkOS_createThread into the RTS so its implementation can be
dependent on RTS_SUPPORTS_THREADS, which means we can provide a stub
implementation in the !RTS_SUPPORTS_THREADS case, and hence not depend
on pthread_create, which requires -lpthread.  The upshot is that GHCi
now works again when !RTS_SUPPORTS_THREADS.

20 years ago[project @ 2003-09-24 10:32:11 by simonmar]
simonmar [Wed, 24 Sep 2003 10:32:12 +0000 (10:32 +0000)]
[project @ 2003-09-24 10:32:11 by simonmar]
If we change the terminal settings as a result of hSetBuffering or
hSetEcho, then restore them again in hs_exit().  This is just good
citizenship on Unixy platforms.

We *don't* just automatically save the terminal settings and restore
them at the end, because that would prevent implementing stty-like
programs in Haskell.  This scheme is a compromise that hopefully DTRT
in most cases.

20 years ago[project @ 2003-09-23 17:07:39 by sof]
sof [Tue, 23 Sep 2003 17:07:39 +0000 (17:07 +0000)]
[project @ 2003-09-23 17:07:39 by sof]
wibble

20 years ago[project @ 2003-09-23 16:52:44 by sof]
sof [Tue, 23 Sep 2003 16:52:45 +0000 (16:52 +0000)]
[project @ 2003-09-23 16:52:44 by sof]
If the user explicitly did an instances-only import, i.e.,
"import Foo ()", don't emit an unused-import warning.

20 years ago[project @ 2003-09-23 16:43:00 by wolfgang]
wolfgang [Tue, 23 Sep 2003 16:43:00 +0000 (16:43 +0000)]
[project @ 2003-09-23 16:43:00 by wolfgang]
Mac OS X uses .dylib instead of .so, recognize that properly.

20 years ago[project @ 2003-09-23 16:02:34 by simonmar]
simonmar [Tue, 23 Sep 2003 16:02:34 +0000 (16:02 +0000)]
[project @ 2003-09-23 16:02:34 by simonmar]
Change some statics to dynamics, and remove a couple of obsolete options.

20 years ago[project @ 2003-09-23 16:01:22 by simonmar]
simonmar [Tue, 23 Sep 2003 16:01:22 +0000 (16:01 +0000)]
[project @ 2003-09-23 16:01:22 by simonmar]
Some wibbles to the optimisation section.

20 years ago[project @ 2003-09-23 15:38:35 by simonmar]
simonmar [Tue, 23 Sep 2003 15:38:36 +0000 (15:38 +0000)]
[project @ 2003-09-23 15:38:35 by simonmar]
Add a BF_PINNED block flag, and attach it to blocks containing pinned
objects (in addition to the usual BF_LARGE).

In heapCensus, we now ignore blocks containing pinned objects, because
they might contain gaps, and in any case it isn't clear that we want
to include the whole block in a heap census, because much of it might
well be dead.  Ignoring it isn't right either, though, so this patch
just fixes the crash and leaves a ToDo.

20 years ago[project @ 2003-09-23 15:31:02 by simonmar]
simonmar [Tue, 23 Sep 2003 15:31:02 +0000 (15:31 +0000)]
[project @ 2003-09-23 15:31:02 by simonmar]
Fix for clearing the evacuated flag on a block: don't throw away other
flag settings in the process.

20 years ago[project @ 2003-09-23 15:29:02 by simonpj]
simonpj [Tue, 23 Sep 2003 15:29:02 +0000 (15:29 +0000)]
[project @ 2003-09-23 15:29:02 by simonpj]
--------------------------
         Much grunting about let-floating
   --------------------------

We want to avoid putting bindings between the '=' of a defn and a '\':
let { f = let ... in \y-> ... } in ...

Reason: float-in often follows float-out, and it may then add yte
more bindings there, some of which may be strict.  But f may by
not be marked as not-demanded (for other reasons: see the call to
zapDemandInfo in Simplify.completeLazyBind); and now the strict binding
may not be able to float out again.  (Well, it triggers the ASSERT in
simplLazyBind.)

So this commit adds FloatOut.floatNonRecRhs (to complement floatRhs) which
is a big more vigorous about floating out.

But that in turn showed up a pile of gore to do with unlifted bindings.
We can't have them showing up at top level.  After thrashing in the swamp
for a while, I eventually arranged that
let x# = e in b
(where x# has an unlifted type) is treated exactly like
case e of x# -> b
That is, it is never floated.  Yes, we lose opportunities to float some
(very cheap!  unlifted let-bindings are always cheap) out of a lambda,
but we're missing much bigger opportunities already.  For example:
\x -> f (h y)

where h :: Int -> Int# is expensive. We'd like to float the (h y) outside
the \x, but we don't because it's unboxed.  Possible solution: box it.
Anyway, that's for the future.

20 years ago[project @ 2003-09-23 15:15:02 by simonpj]
simonpj [Tue, 23 Sep 2003 15:15:03 +0000 (15:15 +0000)]
[project @ 2003-09-23 15:15:02 by simonpj]
--------------------------
     Move demand-zapping code to where it belongs
   --------------------------

A rather subtle point in the simplifier concerns the zapping of demand-info
when the RHS of a binding is a value.  This used to be tucked away inside
IdInfo where it was hard to find.  This commit moves the code to Simplify,
so it occurs where you'd look for it.  Along with copious comments.

See the zapDemandInfo in Simplify.completeLazyBind

20 years ago[project @ 2003-09-23 15:10:43 by simonpj]
simonpj [Tue, 23 Sep 2003 15:10:43 +0000 (15:10 +0000)]
[project @ 2003-09-23 15:10:43 by simonpj]
Add more informative assertion

20 years ago[project @ 2003-09-23 15:10:23 by simonpj]
simonpj [Tue, 23 Sep 2003 15:10:23 +0000 (15:10 +0000)]
[project @ 2003-09-23 15:10:23 by simonpj]
Comment only

20 years ago[project @ 2003-09-23 15:09:56 by simonpj]
simonpj [Tue, 23 Sep 2003 15:09:56 +0000 (15:09 +0000)]
[project @ 2003-09-23 15:09:56 by simonpj]
Remove redundant where

20 years ago[project @ 2003-09-23 15:09:09 by simonpj]
simonpj [Tue, 23 Sep 2003 15:09:09 +0000 (15:09 +0000)]
[project @ 2003-09-23 15:09:09 by simonpj]
--------------------------
     Make MachString literals a bit bigger
   --------------------------

Up to now, unboxed string literals of up to 3 characters had
size 1, which means they are inlined in place of a variable.
That seems over-eager (duplication), so I've upped their size a bit.

20 years ago[project @ 2003-09-23 15:05:18 by simonmar]
simonmar [Tue, 23 Sep 2003 15:05:18 +0000 (15:05 +0000)]
[project @ 2003-09-23 15:05:18 by simonmar]
Fixes for the DEBUG case.

20 years ago[project @ 2003-09-23 14:32:57 by simonmar]
simonmar [Tue, 23 Sep 2003 14:33:05 +0000 (14:33 +0000)]
[project @ 2003-09-23 14:32:57 by simonmar]
- Convert many of the optimisation options into dynamic options (that is,
  they can be mentioned in {-# OPTIONS #-} pragmas).

- Add a new way to specify constructor-field unboxing on a selective
  basis.  To tell the compiler to unbox a constructor field, do this:

      data T = T !!Int

  and GHC will store that field unboxed if possible.  If it isn't possible
  (say, because the field has a sum type) then the annotation is ignored.

  The -funbox-strict-fields flag is now a dynamic flag, and has the same
  effect as replacing all the '!' annotations with '!!'.

20 years ago[project @ 2003-09-23 14:25:48 by simonmar]
simonmar [Tue, 23 Sep 2003 14:25:48 +0000 (14:25 +0000)]
[project @ 2003-09-23 14:25:48 by simonmar]
Allow .so or .dll libraries to be named explicitly on the command line.

20 years ago[project @ 2003-09-21 22:20:51 by wolfgang]
wolfgang [Sun, 21 Sep 2003 22:20:57 +0000 (22:20 +0000)]
[project @ 2003-09-21 22:20:51 by wolfgang]
Bound Threads
=============

Introduce a way to use foreign libraries that rely on thread local state
from multiple threads (mainly affects the threaded RTS).

See the file threads.tex in CVS at haskell-report/ffi/threads.tex
(not entirely finished yet) for a definition of this extension. A less formal
description is also found in the documentation of Control.Concurrent.

The changes mostly affect the THREADED_RTS (./configure --enable-threaded-rts),
except for saving & restoring errno on a per-TSO basis, which is also necessary
for the non-threaded RTS (a bugfix).

Detailed list of changes
------------------------

- errno is saved in the TSO object and restored when necessary:
ghc/includes/TSO.h, ghc/rts/Interpreter.c, ghc/rts/Schedule.c

- rts_mainLazyIO is no longer needed, main is no special case anymore
ghc/includes/RtsAPI.h, ghc/rts/RtsAPI.c, ghc/rts/Main.c, ghc/rts/Weak.c

- passCapability: a new function that releases the capability and "passes"
  it to a specific OS thread:
ghc/rts/Capability.h ghc/rts/Capability.c

- waitThread(), scheduleWaitThread() and schedule() get an optional
  Capability *initialCapability passed as an argument:
ghc/includes/SchedAPI.h, ghc/rts/Schedule.c, ghc/rts/RtsAPI.c

- Bound Thread scheduling (that's what this is all about):
ghc/rts/Schedule.h, ghc/rts/Schedule.c

- new Primop isCurrentThreadBound#:
ghc/compiler/prelude/primops.txt.pp, ghc/includes/PrimOps.h, ghc/rts/PrimOps.hc,
ghc/rts/Schedule.h, ghc/rts/Schedule.c

- a simple function, rtsSupportsBoundThreads, that returns true if THREADED_RTS
  is defined:
ghc/rts/Schedule.h, ghc/rts/Schedule.c

- a new implementation of forkProcess (the old implementation stays in place
  for the non-threaded case). Partially broken; works for the standard
  fork-and-exec case, but not for much else. A proper forkProcess is
  really next to impossible to implement:
ghc/rts/Schedule.c

- Library support for bound threads:
    Control.Concurrent.
      rtsSupportsBoundThreads, isCurrentThreadBound, forkOS,
      runInBoundThread, runInUnboundThread
libraries/base/Control/Concurrent.hs, libraries/base/Makefile,
libraries/base/include/HsBase.h, libraries/base/cbits/forkOS.c (new file)

20 years ago[project @ 2003-09-21 13:26:05 by igloo]
igloo [Sun, 21 Sep 2003 13:26:05 +0000 (13:26 +0000)]
[project @ 2003-09-21 13:26:05 by igloo]
Generalise the x86-64 hack to all 64-bit arches.

20 years ago[project @ 2003-09-21 13:22:01 by igloo]
igloo [Sun, 21 Sep 2003 13:22:03 +0000 (13:22 +0000)]
[project @ 2003-09-21 13:22:01 by igloo]
Alpha fixes.

20 years ago[project @ 2003-09-21 13:09:12 by igloo]
igloo [Sun, 21 Sep 2003 13:09:12 +0000 (13:09 +0000)]
[project @ 2003-09-21 13:09:12 by igloo]
Change IF_OS_darwin to IF_ARCH_powerpc so addImportNat is imported in
exactly the case in which it is used.

20 years ago[project @ 2003-09-21 13:07:07 by igloo]
igloo [Sun, 21 Sep 2003 13:07:07 +0000 (13:07 +0000)]
[project @ 2003-09-21 13:07:07 by igloo]
Add cases for:

arm-unknown-linux
hppa-unknown-linux
m68k-unknown-linux
mips-unknown-linux
s390-ibm-linux

20 years ago[project @ 2003-09-20 17:26:46 by ross]
ross [Sat, 20 Sep 2003 17:26:49 +0000 (17:26 +0000)]
[project @ 2003-09-20 17:26:46 by ross]
Re-arrange the interface to TcMatches to allow typechecking of case
commands (part of arrow notation):

* replace the export of the internal tcGRHSs with a more specific
  tcGRHSsPat for checking PatMonoBinds.

* generalize match contexts in the same way as stmt contexts, to include
  a typechecker for the bodies of alts.

This should probably be reviewed, but I hope it can make it into STABLE
after a while.

20 years ago[project @ 2003-09-20 17:24:47 by ross]
ross [Sat, 20 Sep 2003 17:24:47 +0000 (17:24 +0000)]
[project @ 2003-09-20 17:24:47 by ross]
fixes to desugaring of arrow notation:

* fix free variable calculation for if's

* various fixes for case

please merge to STABLE

20 years ago[project @ 2003-09-19 18:56:00 by wolfgang]
wolfgang [Fri, 19 Sep 2003 18:56:00 +0000 (18:56 +0000)]
[project @ 2003-09-19 18:56:00 by wolfgang]
POSIX threads should be pthread_detach-ed after they are created.
Otherwise they'll stick around waiting for a pthread_join.

(This wasn't really a problem because our worker threads never exit anyway).

20 years ago[project @ 2003-09-19 15:58:00 by simonmar]
simonmar [Fri, 19 Sep 2003 15:58:00 +0000 (15:58 +0000)]
[project @ 2003-09-19 15:58:00 by simonmar]
The whole family of index<blah>OffForeignPtr# primops has been broken
for some time now.  This commit fixes them.

I'm tempted to get rid of them altogether, since arguably the
withForeignPtr interface subsumes all this.  But if you want to index
off a ForeignPtr in pure code, you have to use unsafePerformIO, which
is hard to optimise away (GHC doesn't do it), so these primops still
have their uses.

20 years ago[project @ 2003-09-19 09:12:22 by simonmar]
simonmar [Fri, 19 Sep 2003 09:12:22 +0000 (09:12 +0000)]
[project @ 2003-09-19 09:12:22 by simonmar]
Be a bit more honest about how easy it is to port the linker.

20 years ago[project @ 2003-09-19 09:04:09 by simonmar]
simonmar [Fri, 19 Sep 2003 09:04:09 +0000 (09:04 +0000)]
[project @ 2003-09-19 09:04:09 by simonmar]
Add irix_TARGET_OS support.

20 years ago[project @ 2003-09-17 21:20:16 by sof]
sof [Wed, 17 Sep 2003 21:20:16 +0000 (21:20 +0000)]
[project @ 2003-09-17 21:20:16 by sof]
usage_text[]: -k doc wibble

20 years ago[project @ 2003-09-17 08:39:26 by panne]
panne [Wed, 17 Sep 2003 08:39:26 +0000 (08:39 +0000)]
[project @ 2003-09-17 08:39:26 by panne]
Simplified my previous quick-fix-after-some-beers

20 years ago[project @ 2003-09-17 04:35:01 by mthomas]
mthomas [Wed, 17 Sep 2003 04:35:01 +0000 (04:35 +0000)]
[project @ 2003-09-17 04:35:01 by mthomas]
Switch examples on/off

20 years ago[project @ 2003-09-16 17:50:15 by panne]
panne [Tue, 16 Sep 2003 17:50:15 +0000 (17:50 +0000)]
[project @ 2003-09-16 17:50:15 by panne]
Make "one of the most hammered bits in the whole compiler" (quotation
from the source code :-) compile without _ccall_

20 years ago[project @ 2003-09-16 17:09:53 by ross]
ross [Tue, 16 Sep 2003 17:09:53 +0000 (17:09 +0000)]
[project @ 2003-09-16 17:09:53 by ross]
CasmTarget is gone

20 years ago[project @ 2003-09-16 13:06:21 by simonmar]
simonmar [Tue, 16 Sep 2003 13:06:21 +0000 (13:06 +0000)]
[project @ 2003-09-16 13:06:21 by simonmar]
-funfold-casms-in-hi-file is no more.

20 years ago[project @ 2003-09-16 13:03:37 by simonmar]
simonmar [Tue, 16 Sep 2003 13:03:49 +0000 (13:03 +0000)]
[project @ 2003-09-16 13:03:37 by simonmar]
Legacy Removal
~~~~~~~~~~~~~~

The following features have been consigned to the bit bucket:

  _ccall_
  _casm_
  ``....''  (lit-lits)
  the CCallable class
  the CReturnable class

20 years ago[project @ 2003-09-15 20:39:38 by sof]
sof [Mon, 15 Sep 2003 20:39:38 +0000 (20:39 +0000)]
[project @ 2003-09-15 20:39:38 by sof]
factor out code that handles depositing of work items on the
  thread pool's request queue.
- when it looks as if a new worker thread needs to be created, give
  up our quantum first in the hope that this might at the last minute
  turn up more idle worker threads.
- add comment re: trimming pool size.

Merged to STABLE eventually; I may continue tinkering with this code
some more over the next day or two.

20 years ago[project @ 2003-09-15 14:20:45 by simonmar]
simonmar [Mon, 15 Sep 2003 14:20:45 +0000 (14:20 +0000)]
[project @ 2003-09-15 14:20:45 by simonmar]
Update comment for GhcUnregisterised.

20 years ago[project @ 2003-09-14 22:02:29 by wolfgang]
wolfgang [Sun, 14 Sep 2003 22:02:29 +0000 (22:02 +0000)]
[project @ 2003-09-14 22:02:29 by wolfgang]
comment wibble
(merge to stable)

20 years ago[project @ 2003-09-14 13:50:57 by chak]
chak [Sun, 14 Sep 2003 13:50:58 +0000 (13:50 +0000)]
[project @ 2003-09-14 13:50:57 by chak]
* Corrected some outdated comments re variables and type checking
* Added some more details about type checking

20 years ago[project @ 2003-09-14 09:04:40 by dons]
dons [Sun, 14 Sep 2003 09:04:40 +0000 (09:04 +0000)]
[project @ 2003-09-14 09:04:40 by dons]
sparc-unknown-openbsd exists and is supported.

Also, we run on Solaris 2.6 as well as 2.7.

20 years ago[project @ 2003-09-13 11:48:29 by matthewc]
matthewc [Sat, 13 Sep 2003 11:48:29 +0000 (11:48 +0000)]
[project @ 2003-09-13 11:48:29 by matthewc]
Update IA64 status (supported except no NCG)

20 years ago[project @ 2003-09-12 16:32:13 by sof]
sof [Fri, 12 Sep 2003 16:32:13 +0000 (16:32 +0000)]
[project @ 2003-09-12 16:32:13 by sof]
delayzh_fast: comment only

20 years ago[project @ 2003-09-12 16:26:05 by sof]
sof [Fri, 12 Sep 2003 16:26:05 +0000 (16:26 +0000)]
[project @ 2003-09-12 16:26:05 by sof]
- Sleep()'s resolution is millisecs, not microsecs.
- adopt a more agressive policy for augmenting the thread pool
  to handle incoming requests (see code comments for details.)

  The previous policy ran the risk of starvation in rare (and hard
  to reproduce) cases, as spotted after having chased a bug
  for two days.

Merge to STABLE

20 years ago[project @ 2003-09-12 16:16:43 by sof]
sof [Fri, 12 Sep 2003 16:16:43 +0000 (16:16 +0000)]
[project @ 2003-09-12 16:16:43 by sof]
- awaitRequests() comments
- code reformatting

Merge to STABLE

20 years ago[project @ 2003-09-12 14:42:36 by sof]
sof [Fri, 12 Sep 2003 14:42:36 +0000 (14:42 +0000)]
[project @ 2003-09-12 14:42:36 by sof]
comment wibble

20 years ago[project @ 2003-09-12 09:46:37 by simonmar]
simonmar [Fri, 12 Sep 2003 09:46:37 +0000 (09:46 +0000)]
[project @ 2003-09-12 09:46:37 by simonmar]
Ignore lines containing

  #pragma .*

generated by GCC 3.3's CPP on MacOS X, apparently.

20 years ago[project @ 2003-09-11 16:46:15 by simonpj]
simonpj [Thu, 11 Sep 2003 16:46:15 +0000 (16:46 +0000)]
[project @ 2003-09-11 16:46:15 by simonpj]
Make sure that exprIsTrivial responds "False" to
(scc "foo" x)

We do not treat (_scc_ "foo" x) as trivial, because
  a) it really generates code, (and a heap object when it's
     a function arg) to capture the cost centre
  b) see the note [SCC-and-exprIsTrivial] in Simplify.simplLazyBind

20 years ago[project @ 2003-09-11 15:36:37 by wolfgang]
wolfgang [Thu, 11 Sep 2003 15:36:37 +0000 (15:36 +0000)]
[project @ 2003-09-11 15:36:37 by wolfgang]
The FP_CHECK_CONSTS test for the errno constants requires stdio.h to be
included, at least on Mac OS X.

MERGE TO STABLE.

20 years ago[project @ 2003-09-11 15:12:25 by wolfgang]
wolfgang [Thu, 11 Sep 2003 15:12:25 +0000 (15:12 +0000)]
[project @ 2003-09-11 15:12:25 by wolfgang]
Mac OS X:

Bypass the dlfcn compatibility layer in lookupSymbol, use Apple's
NSModule functions directly instead. This protects us from differences
between different implementations of the dlcompat library (regarding
treatment of prefixed underscores).
Note that the compatibility layer is still used in addDLL (it's needed by
the POSIX library anyway).

Also, add a little more sanity checking (checkProddableBlock) to the Mach-O
linker itself.

MERGE TO STABLE

20 years ago[project @ 2003-09-11 14:34:24 by simonmar]
simonmar [Thu, 11 Sep 2003 14:34:25 +0000 (14:34 +0000)]
[project @ 2003-09-11 14:34:24 by simonmar]
Document -fth and -fimplicit-params

20 years ago[project @ 2003-09-11 14:20:40 by simonpj]
simonpj [Thu, 11 Sep 2003 14:20:40 +0000 (14:20 +0000)]
[project @ 2003-09-11 14:20:40 by simonpj]
--------------------------
    Allow recursive dictionaries
   --------------------------

In response to various bleatings, here's a lovely fix that involved simply
inverting two lines of code, to allow recursive dictionaries.  Here's
the comment.  (typecheck/should_run/tc030 tests it)

Note [RECURSIVE DICTIONARIES]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
    data D r = ZeroD | SuccD (r (D r));

    instance (Eq (r (D r))) => Eq (D r) where
        ZeroD     == ZeroD     = True
        (SuccD a) == (SuccD b) = a == b
        _         == _         = False;

    equalDC :: D [] -> D [] -> Bool;
    equalDC = (==);

We need to prove (Eq (D [])).  Here's how we go:

d1 : Eq (D [])

by instance decl, holds if
d2 : Eq [D []]
where  d1 = dfEqD d2

by instance decl of Eq, holds if
d3 : D []
where d2 = dfEqList d2
d1 = dfEqD d2

But now we can "tie the knot" to give

d3 = d1
d2 = dfEqList d2
d1 = dfEqD d2

and it'll even run!  The trick is to put the thing we are trying to prove
(in this case Eq (D []) into the database before trying to prove its
contributing clauses.

20 years ago[project @ 2003-09-11 14:18:38 by simonpj]
simonpj [Thu, 11 Sep 2003 14:18:38 +0000 (14:18 +0000)]
[project @ 2003-09-11 14:18:38 by simonpj]
Add comments, change a WARN to an ASSERT

20 years ago[project @ 2003-09-11 13:41:38 by simonpj]
simonpj [Thu, 11 Sep 2003 13:41:38 +0000 (13:41 +0000)]
[project @ 2003-09-11 13:41:38 by simonpj]
Undo bogus claim that
_scc_ "foo" x  ==  x

This just isn't right in general, for example when x is a
top-level function.

20 years ago[project @ 2003-09-11 10:36:56 by simonmar]
simonmar [Thu, 11 Sep 2003 10:36:56 +0000 (10:36 +0000)]
[project @ 2003-09-11 10:36:56 by simonmar]
HEAD is now 6.3

20 years ago[project @ 2003-09-11 10:35:28 by simonmar]
simonmar [Thu, 11 Sep 2003 10:35:28 +0000 (10:35 +0000)]
[project @ 2003-09-11 10:35:28 by simonmar]
When setting TARGETPLATFORM, we should also set foo_TARGET_ARCH,
bar_TARGET_OS, etc.

20 years ago[project @ 2003-09-11 10:26:31 by simonmar]
simonmar [Thu, 11 Sep 2003 10:26:31 +0000 (10:26 +0000)]
[project @ 2003-09-11 10:26:31 by simonmar]
Add missing 'cd T' to the porting instructions.

20 years ago[project @ 2003-09-11 09:29:22 by simonmar]
simonmar [Thu, 11 Sep 2003 09:29:22 +0000 (09:29 +0000)]
[project @ 2003-09-11 09:29:22 by simonmar]
The reify keywords should be valid when template haskell is turned on.

20 years ago[project @ 2003-09-11 05:05:34 by sof]
sof [Thu, 11 Sep 2003 05:05:34 +0000 (05:05 +0000)]
[project @ 2003-09-11 05:05:34 by sof]
hGetStringBuffer: open file in binary mode

20 years ago[project @ 2003-09-11 00:58:02 by sof]
sof [Thu, 11 Sep 2003 00:58:02 +0000 (00:58 +0000)]
[project @ 2003-09-11 00:58:02 by sof]
Fix race condition re: WorkItems and SubmitWork().

It is unsafe to access a WorkItem after it has been queued, since
a worker thread may have already serviced (and freed) it.
Hence, return request IDs without looking at the WorkItem.

If desired, this one could be merged to STABLE.

20 years ago[project @ 2003-09-11 00:39:04 by sof]
sof [Thu, 11 Sep 2003 00:39:04 +0000 (00:39 +0000)]
[project @ 2003-09-11 00:39:04 by sof]
awaitRequests(): canonicalize removal of thread from blocked_queue

20 years ago[project @ 2003-09-10 16:44:03 by simonmar]
simonmar [Wed, 10 Sep 2003 16:44:05 +0000 (16:44 +0000)]
[project @ 2003-09-10 16:44:03 by simonmar]
New flags for individual syntax extensions:

  -fth                enables template haskell
  -fimplicit-params   enables implicit parameters

These extensions are still implied by -fglasgow-exts, but they can now
be switched off individually with -fno-th and -fno-implicit-params
respectively.  Also, -fno-ffi now works as expected.

I cleaned up the interface to the lexer a bit while I was here.

20 years ago[project @ 2003-09-10 14:45:24 by simonmar]
simonmar [Wed, 10 Sep 2003 14:45:25 +0000 (14:45 +0000)]
[project @ 2003-09-10 14:45:24 by simonmar]
Quick hack to work around the dynamic exception crashes in GHCi.  The
problem is this: the Data.Typeable library (Data.Dymamic in previous
versions of GHC) maintains an internal cache mapping type names to
unique numbers, and this cache is used for fast comparisons on
TypeReps.  In GHCi, there are actually two versions of the
Data.Typeable library loaded: one linked to GHCi itself, and the other
dynamically loaded, so there are two copies of the hash tables.

The problem is that if we have a Dynamic value generated using one set
of hash tables, it will erroneously appear to be of a different type
when the other hash tables are used.

The hack I've instigated is to use the central RTS genSym (which
already exists) to generate the unique Ids, so that the two copies of
the dynamic library will be using distinct Ids, and Dynamics from one
will never be recognisable to the other.

20 years ago[project @ 2003-09-09 11:18:25 by simonmar]
simonmar [Tue, 9 Sep 2003 11:18:25 +0000 (11:18 +0000)]
[project @ 2003-09-09 11:18:25 by simonmar]
Slight amendment to the porting instructions to ensure that the
target's config.h doesn't get overwritten on the host system.

20 years ago[project @ 2003-09-09 09:49:49 by simonmar]
simonmar [Tue, 9 Sep 2003 09:49:49 +0000 (09:49 +0000)]
[project @ 2003-09-09 09:49:49 by simonmar]
Build Happy, Alex, and Haddock before GHC if they are in this source tree.

20 years ago[project @ 2003-09-09 09:12:36 by simonmar]
simonmar [Tue, 9 Sep 2003 09:12:36 +0000 (09:12 +0000)]
[project @ 2003-09-09 09:12:36 by simonmar]
Back out previous revision

20 years ago[project @ 2003-09-09 09:08:42 by panne]
panne [Tue, 9 Sep 2003 09:08:43 +0000 (09:08 +0000)]
[project @ 2003-09-09 09:08:42 by panne]
Teach ghc-pkg the now standard -?/-V options

20 years ago[project @ 2003-09-09 08:50:50 by simonmar]
simonmar [Tue, 9 Sep 2003 08:50:50 +0000 (08:50 +0000)]
[project @ 2003-09-09 08:50:50 by simonmar]
Oops, forgot to commit this file with the new lexer.  M.() is no
longer legal.

20 years ago[project @ 2003-09-09 08:40:38 by panne]
panne [Tue, 9 Sep 2003 08:40:38 +0000 (08:40 +0000)]
[project @ 2003-09-09 08:40:38 by panne]
Recognize the qualified unit as a lexeme when -fglasgow-exts is on
(which is the case when lexing .hi-boot files).

Note: Should `[]' and `(->)' be recognized similarly?

20 years ago[project @ 2003-09-08 17:55:40 by sof]
sof [Mon, 8 Sep 2003 17:55:40 +0000 (17:55 +0000)]
[project @ 2003-09-08 17:55:40 by sof]
New option, -DNAME=VAL, for adding to the set of
variables substituted for when processing a package
description.

(Needed to support Windows installers for GHC packages.)

20 years ago[project @ 2003-09-08 14:46:37 by panne]
panne [Mon, 8 Sep 2003 14:46:37 +0000 (14:46 +0000)]
[project @ 2003-09-08 14:46:37 by panne]
*sigh* Handle lines like (note the blank!):

{-# LINE 1 "<command line>" #-}

20 years ago[project @ 2003-09-08 14:23:11 by simonmar]
simonmar [Mon, 8 Sep 2003 14:23:11 +0000 (14:23 +0000)]
[project @ 2003-09-08 14:23:11 by simonmar]
The POSIX library has more or less completed moving over to the
hierarchical libraries, so remove the statement that says it hasn't
moved.

We should really aim to have everything moved from hslibs to libraries
before 6.2, then we can finally remove hslibs altogether for 6.4.

20 years ago[project @ 2003-09-08 13:33:29 by simonmar]
simonmar [Mon, 8 Sep 2003 13:33:29 +0000 (13:33 +0000)]
[project @ 2003-09-08 13:33:29 by simonmar]
Two more tokens that herald layout contexts: 'rec' and '[d|'.

20 years ago[project @ 2003-09-08 13:31:35 by panne]
panne [Mon, 8 Sep 2003 13:31:35 +0000 (13:31 +0000)]
[project @ 2003-09-08 13:31:35 by panne]
Handle lines like (note the blank!):

# 1 "<command line>"

20 years ago[project @ 2003-09-08 13:20:29 by simonmar]
simonmar [Mon, 8 Sep 2003 13:20:29 +0000 (13:20 +0000)]
[project @ 2003-09-08 13:20:29 by simonmar]
Add Alex as a pre-supposed tool, and mention it in a few places.

20 years ago[project @ 2003-09-08 13:01:16 by simonmar]
simonmar [Mon, 8 Sep 2003 13:01:16 +0000 (13:01 +0000)]
[project @ 2003-09-08 13:01:16 by simonmar]
mdo needs layout treatment too.

20 years ago[project @ 2003-09-08 11:53:14 by simonmar]
simonmar [Mon, 8 Sep 2003 11:53:14 +0000 (11:53 +0000)]
[project @ 2003-09-08 11:53:14 by simonmar]
Remove old lexer; replaced by Lexer.x.

20 years ago[project @ 2003-09-08 11:52:24 by simonmar]
simonmar [Mon, 8 Sep 2003 11:52:27 +0000 (11:52 +0000)]
[project @ 2003-09-08 11:52:24 by simonmar]
Replace the handwritten lexer with one generated by Alex.

YOU NOW NEED ALEX (v 2.0 or later) TO COMPILE GHC FROM CVS.

Highlights:

  - Faster than the previous lexer (about 10% of total parse time,
    depending on the token mix).

  - More correct than the previous lexer: a couple of minor wibbles
    in the syntax were fixed.

  - Completely accurate source spans for each token are now collected.
    This information isn't used yet, but it will be used to give much
    more accurate error messages in the future.

  - SrcLoc now contains a column field as well as a line number,
    although this is currently ignored when printing out SrcLocs.

  - StringBuffer is now based on a ByteArray# rather than a Ptr, which
    means that StringBuffers are now garbage collected.  Previously
    StringBuffers were hardly ever released, so a GHCi session would
    leak space as more source files were loaded in.

  - Code size reduction: Lexer.x is about the same size as the old
    Lex.lhs, but StringBuffer.lhs is significantly shorter and
    simpler.  Sadly I wasn't able to get rid of parser/Ctypes.hs
    (yet).

20 years ago[project @ 2003-09-08 09:05:42 by simonmar]
simonmar [Mon, 8 Sep 2003 09:05:42 +0000 (09:05 +0000)]
[project @ 2003-09-08 09:05:42 by simonmar]
Update comp.lang.functional FAQ URL.

20 years ago[project @ 2003-09-05 09:51:02 by simonmar]
simonmar [Fri, 5 Sep 2003 09:51:02 +0000 (09:51 +0000)]
[project @ 2003-09-05 09:51:02 by simonmar]
Add powerpc-unknown-linux.

20 years ago[project @ 2003-09-04 13:58:12 by simonmar]
simonmar [Thu, 4 Sep 2003 13:58:12 +0000 (13:58 +0000)]
[project @ 2003-09-04 13:58:12 by simonmar]
- Document -e

- Rearrange the documentation on "modes".  I've moved the list of
  modes from the beginning of "Using GHC", to a subsection a little
  later, and the sections describing make-mode and batch-mode are now
  further subsections of this.

- Add missing modes to the list: -M and --mk-dll.

20 years ago[project @ 2003-09-04 11:08:46 by simonmar]
simonmar [Thu, 4 Sep 2003 11:08:48 +0000 (11:08 +0000)]
[project @ 2003-09-04 11:08:46 by simonmar]
Add a new command-line flag -e EXPR, which runs ghc in interactive
mode and evaluates EXPR only before exiting.

Also, the lexer now ignores lines beginning with "#!".  This is so
that we can use ghc as a scripting language with Unix-style scripts
beginning with

#! /usr/local/bin/ghc -e main

(well, it's not quite that simple, but I'll leave the details for the
more enterprising hackers).

20 years ago[project @ 2003-09-04 09:56:16 by simonmar]
simonmar [Thu, 4 Sep 2003 09:56:16 +0000 (09:56 +0000)]
[project @ 2003-09-04 09:56:16 by simonmar]
Don't bogusly use HOST instead of BUILD or TARGET in the platform defines.

20 years ago[project @ 2003-09-04 09:55:28 by simonmar]
simonmar [Thu, 4 Sep 2003 09:55:28 +0000 (09:55 +0000)]
[project @ 2003-09-04 09:55:28 by simonmar]
Flesh out the platform variables, rather than bogusly setting BUILD
and TARGET to HOST most of the time.

This doesn't give us any better cross-compiling support, but it's a
step in the right direction.

Also, I added a comment describing the proper meaning of BUILD
vs. HOST vs. TARGET, and which one to test in various parts of the
source tree.

20 years ago[project @ 2003-09-04 09:53:31 by simonmar]
simonmar [Thu, 4 Sep 2003 09:53:31 +0000 (09:53 +0000)]
[project @ 2003-09-04 09:53:31 by simonmar]
Uncomment AC_SUBSTs for many of the platform variables, since I'm
guessing that this comment doesn't apply any more:

dnl Cannot afford all these SUBSTs (because of braindead seds w/ 99 cmd limits)

20 years ago[project @ 2003-09-03 13:16:37 by simonmar]
simonmar [Wed, 3 Sep 2003 13:16:37 +0000 (13:16 +0000)]
[project @ 2003-09-03 13:16:37 by simonmar]
Update the unregisterised bootstrapping instructions to recommend
using hc-build, and rearange some things.

20 years ago[project @ 2003-09-03 11:15:19 by simonmar]
simonmar [Wed, 3 Sep 2003 11:15:19 +0000 (11:15 +0000)]
[project @ 2003-09-03 11:15:19 by simonmar]
Add SplitObjs=NO and GhcLibWays=  to the build.mk when doing an
unregisterised bootstrap.

20 years ago[project @ 2003-09-02 10:26:53 by simonmar]
simonmar [Tue, 2 Sep 2003 10:26:53 +0000 (10:26 +0000)]
[project @ 2003-09-02 10:26:53 by simonmar]
Wibbles to the touching of files to avoid unecessary recompilation
when doing 'make install' in a tree after bootstrapping.