ghc-hetmet.git
21 years ago[project @ 2002-11-13 12:21:08 by simonmar]
simonmar [Wed, 13 Nov 2002 12:21:09 +0000 (12:21 +0000)]
[project @ 2002-11-13 12:21:08 by simonmar]
Add support for gcc-style "make bootstrap" which will build the stage
1, 2 and 3 compilers in the same build tree.

The idea is to simplify building a stage 2 or 3 compiler (now you only
need one build tree), and also speed up the build: there's no need to
compile the libraries more than once, because the stage 1 libraries
are used for stages 2 & 3.

In ghc/compiler, the objects and .hi files are now placed in
subdirectories: ghc/compiler/stage1 has the stage1 objects,
ghc/compiler/stage2 has the stage2 objects, etc.

The story from the top-level (fptools) is this:

  make all    works as before (i.e. builds ghc (stage 1),
  libraries, etc.)

  make stage2     builds the stage 2 compiler
  make stage3     builds the stage 3 compiler

  make bootstrap  does 'make all' followed by 'make stage2'
  make bootstrap3 does 'make all' followed by 'make stage2; make stage3'

In ghc/compiler, the story is now:

  make all      works as before (i.e. builds stage 1 only)

  make boot          generate build dirs and dependencies for stage 1
  make boot stage=N  generate build dirs and dependencies for stage N

  make stageN
  make stage=N       builds stage N compiler.  Run it in-place using
    ./stageN/ghc-inplace.

I haven't decided what to do about 'make install' yet, and this still
needs documenting in the Building Guide.  Also, you still get the same
$(GhcHcOpts) for each stage.

21 years ago[project @ 2002-11-13 09:57:02 by chak]
chak [Wed, 13 Nov 2002 09:57:02 +0000 (09:57 +0000)]
[project @ 2002-11-13 09:57:02 by chak]
Added forall's to the representation of type terms

21 years ago[project @ 2002-11-13 07:17:34 by chak]
chak [Wed, 13 Nov 2002 07:17:34 +0000 (07:17 +0000)]
[project @ 2002-11-13 07:17:34 by chak]
More details about the handling of binders in DsMeta

21 years ago[project @ 2002-11-11 18:42:09 by panne]
panne [Mon, 11 Nov 2002 18:42:09 +0000 (18:42 +0000)]
[project @ 2002-11-11 18:42:09 by panne]
Warning police: Removed "possibly uninitialized variable" warning.

21 years ago[project @ 2002-11-11 15:49:58 by simonmar]
simonmar [Mon, 11 Nov 2002 15:49:58 +0000 (15:49 +0000)]
[project @ 2002-11-11 15:49:58 by simonmar]
- embelish the documentation for +RTS -xc a bit

- add some more question/answer pairs to the FAQ

21 years ago[project @ 2002-11-11 11:18:39 by simonmar]
simonmar [Mon, 11 Nov 2002 11:18:39 +0000 (11:18 +0000)]
[project @ 2002-11-11 11:18:39 by simonmar]
Increase the size of many of the int variables used in hp2ps to 64
bits on a 32 bit machine, since they can easily overflow if the
program runs for a few seconds.

Fortunately there was a useful typedef to change - I couldn't be
bothered figuring out exactly which variables to make wider, and the
performance of hp2ps isn't really critical anyhow (this change makes
it about 30% slower, but who cares).

21 years ago[project @ 2002-11-11 11:04:10 by simonpj]
simonpj [Mon, 11 Nov 2002 11:04:10 +0000 (11:04 +0000)]
[project @ 2002-11-11 11:04:10 by simonpj]
-----------------
Template Haskell
-----------------

Template Haskell should now work in all modes!

Remove test for --make/--interactive mode.

21 years ago[project @ 2002-11-11 11:02:55 by simonpj]
simonpj [Mon, 11 Nov 2002 11:02:55 +0000 (11:02 +0000)]
[project @ 2002-11-11 11:02:55 by simonpj]
Back out accidental commit

21 years ago[project @ 2002-11-11 10:59:07 by simonpj]
simonpj [Mon, 11 Nov 2002 10:59:09 +0000 (10:59 +0000)]
[project @ 2002-11-11 10:59:07 by simonpj]
Comments only

21 years ago[project @ 2002-11-11 10:58:40 by simonpj]
simonpj [Mon, 11 Nov 2002 10:58:40 +0000 (10:58 +0000)]
[project @ 2002-11-11 10:58:40 by simonpj]
------------------
   Improve byte-code compilation of unboxed
  tuple returns
------------------

The previous byte-code for returning unboxed tuples was just wrong.  It's
a special case for the situation where we return (# s, x #), where s is
a state token, so we can just return the single result 'x' on top of the
stack.  Previously we generated an ENTER at the end, which is plain wrong.
We should RETURN.

It still doesn't work, for other tiresome reasons...but rather than fix it
we'll wait for eval-apply.  Meanwhile it's less wrong than before.

21 years ago[project @ 2002-11-11 10:53:28 by simonpj]
simonpj [Mon, 11 Nov 2002 10:53:29 +0000 (10:53 +0000)]
[project @ 2002-11-11 10:53:28 by simonpj]
------------------
      Fix a newtype-deriving bug
------------------

The new newtype-deriving mechanism was erroneously using the
*representation type* of the newtype.  The rep type looks through all
ihtermediate newtypes, so that is wrong.  See Note [newtype
representation] in TcDeriv.lhs

deriving/should_run/drvrun013 now tests for this.

21 years ago[project @ 2002-11-09 09:58:56 by chak]
chak [Sat, 9 Nov 2002 09:58:57 +0000 (09:58 +0000)]
[project @ 2002-11-09 09:58:56 by chak]
Changed implementation of representation of negation to use function
application instead of a special syntactic form as suggested by SPJ.

21 years ago[project @ 2002-11-09 09:31:36 by chak]
chak [Sat, 9 Nov 2002 09:31:37 +0000 (09:31 +0000)]
[project @ 2002-11-09 09:31:36 by chak]
Some documentation covering the extra desugaring that is needed for Template
Haskell.

21 years ago[project @ 2002-11-08 15:21:27 by simonpj]
simonpj [Fri, 8 Nov 2002 15:21:28 +0000 (15:21 +0000)]
[project @ 2002-11-08 15:21:27 by simonpj]
--------------------------------
Expression simplification for TH
--------------------------------

Simplify expressions without any inlining in SimplCore.simplifyExpr.

simplifyExpr is used to simplify a TH splice before running the code,
and simplifyExpr was using (SimplPhase 0) which allows inlining.
Unfortunately, when -O is on (which can happen when compiling a program
with some splices with -O) some inlining can happen which then confuses
the byte-code generator.  (Unboxed tuples.)

21 years ago[project @ 2002-11-08 15:16:50 by simonpj]
simonpj [Fri, 8 Nov 2002 15:16:50 +0000 (15:16 +0000)]
[project @ 2002-11-08 15:16:50 by simonpj]
Wibbles

21 years ago[project @ 2002-11-08 12:52:51 by simonmar]
simonmar [Fri, 8 Nov 2002 12:52:51 +0000 (12:52 +0000)]
[project @ 2002-11-08 12:52:51 by simonmar]
oops, should really check for .hi-boot-<version> before .hi-boot

21 years ago[project @ 2002-11-08 09:01:06 by simonpj]
simonpj [Fri, 8 Nov 2002 09:01:07 +0000 (09:01 +0000)]
[project @ 2002-11-08 09:01:06 by simonpj]
------------------
      More TH stuff (thanks to Ian L)
------------------

* Make TH Literals have an Integer not an Int
* Desguar TH 'foreign import' a bit better
* Minor documentation changes

21 years ago[project @ 2002-11-07 14:42:25 by simonmar]
simonmar [Thu, 7 Nov 2002 14:42:25 +0000 (14:42 +0000)]
[project @ 2002-11-07 14:42:25 by simonmar]
Put a "warning:" prefix on a DEBUG belch msg to make it clearer that
this isn't an error.

21 years ago[project @ 2002-11-07 11:42:48 by simonpj]
simonpj [Thu, 7 Nov 2002 11:42:48 +0000 (11:42 +0000)]
[project @ 2002-11-07 11:42:48 by simonpj]
------------------
Fix an obscure bug in implicit parameters,
interacting with lazy pattern matching
------------------

MERGE TO STABLE BRANCH

The problem was this:

  data UniqueSupply = US Integer

  newUnique :: (?uniqueSupply :: UniqueSupply) => Integer
  newUnique = r
            where US r = ?uniqueSupply

The lazy pattern match in the where clause killed GHC 5.04 because the
SourceType {?uniqueSupply::UniqueSupply} of the RHS of the 'where' didn't
look like a UniqueSupply.

The fix is simple: in DsUtils.mkSelectorBinds, use the pattern, not
the rhs, to get the type reqd.  More efficient too.

Test is typecheck/should_compile/tc164.hs

21 years ago[project @ 2002-11-06 13:10:46 by simonpj]
simonpj [Wed, 6 Nov 2002 13:10:47 +0000 (13:10 +0000)]
[project @ 2002-11-06 13:10:46 by simonpj]
------------------
Template Haskell stuff
------------------

a) Pretty printer for TH (thanks to Ian Lynagh)

b) A declaration quote has type Q [Dec], not [Q Dec] as in
   the paper

c) Foreign imports are part of THSyntax, and can be spliced in

21 years ago[project @ 2002-11-06 12:49:47 by simonpj]
simonpj [Wed, 6 Nov 2002 12:49:51 +0000 (12:49 +0000)]
[project @ 2002-11-06 12:49:47 by simonpj]
More wibbles to do with export lists

21 years ago[project @ 2002-11-06 11:34:34 by simonpj]
simonpj [Wed, 6 Nov 2002 11:34:34 +0000 (11:34 +0000)]
[project @ 2002-11-06 11:34:34 by simonpj]
Dont bail out quite so fast

21 years ago[project @ 2002-11-05 22:31:53 by wolfgang]
wolfgang [Tue, 5 Nov 2002 22:31:53 +0000 (22:31 +0000)]
[project @ 2002-11-05 22:31:53 by wolfgang]
Add the appropriate barf for memory allocation failures on Mac OS X.

21 years ago[project @ 2002-11-05 14:10:44 by simonpj]
simonpj [Tue, 5 Nov 2002 14:10:45 +0000 (14:10 +0000)]
[project @ 2002-11-05 14:10:44 by simonpj]
Formatting and dead code

21 years ago[project @ 2002-11-05 11:42:48 by simonpj]
simonpj [Tue, 5 Nov 2002 11:42:49 +0000 (11:42 +0000)]
[project @ 2002-11-05 11:42:48 by simonpj]
------------------
Fix module exports
------------------

GHC was doing the wrong thing when it came to detecting conflicts
on exports from 'module M' items.  This commit fixes it.

There's a test in rename/should_fail/rnfail040

21 years ago[project @ 2002-11-05 09:53:22 by simonpj]
simonpj [Tue, 5 Nov 2002 09:53:22 +0000 (09:53 +0000)]
[project @ 2002-11-05 09:53:22 by simonpj]
Better reporting of unused bindings

21 years ago[project @ 2002-11-05 09:31:37 by simonmar]
simonmar [Tue, 5 Nov 2002 09:31:37 +0000 (09:31 +0000)]
[project @ 2002-11-05 09:31:37 by simonmar]
More wibbles: move the out of memory error message into my_mmap() to
avoid duplication, and add a couple of ToDo comments.

21 years ago[project @ 2002-11-05 09:26:04 by simonmar]
simonmar [Tue, 5 Nov 2002 09:26:04 +0000 (09:26 +0000)]
[project @ 2002-11-05 09:26:04 by simonmar]
Wibble in "out of memory" error message (we actually get to see it
now, rather than "getMBlock: misaligned block...").

21 years ago[project @ 2002-11-05 09:01:10 by simonpj]
simonpj [Tue, 5 Nov 2002 09:01:10 +0000 (09:01 +0000)]
[project @ 2002-11-05 09:01:10 by simonpj]
Wibble when renaming splices

21 years ago[project @ 2002-11-04 15:33:29 by simonpj]
simonpj [Mon, 4 Nov 2002 15:33:30 +0000 (15:33 +0000)]
[project @ 2002-11-04 15:33:29 by simonpj]
Fix reifyDecl

21 years ago[project @ 2002-11-01 11:17:29 by simonmar]
simonmar [Fri, 1 Nov 2002 11:17:29 +0000 (11:17 +0000)]
[project @ 2002-11-01 11:17:29 by simonmar]
warning police: #include <string.h> to get proto for strlen()

21 years ago[project @ 2002-11-01 11:16:33 by simonmar]
simonmar [Fri, 1 Nov 2002 11:16:33 +0000 (11:16 +0000)]
[project @ 2002-11-01 11:16:33 by simonmar]
total_alloc should be a 64-bit couunter.

MERGE TO STABLE

21 years ago[project @ 2002-11-01 11:05:46 by simonmar]
simonmar [Fri, 1 Nov 2002 11:05:47 +0000 (11:05 +0000)]
[project @ 2002-11-01 11:05:46 by simonmar]
Fix the heapCensus crash.

It turned out that after a GC, the small_alloc_list might be non-empty
if a new finalizer thread had been started.  The last block on
small_alloc_list doesn't have the free pointer set correctly (as a
small optimisation, we don't normally set the free pointer after each
allocation, only when the block is full).  The result was that the
free pointer contains the wrong value, and the heap census traverses
garbage.  The fix is to set the free pointer correctly before
traversing small_alloc_list.

The bug doesn't show up when DEBUG is on, because extra DEBUG checks
cause the free pointer to be initialised to a sensible(-ish) value.
Hence my difficulty in reproducing the bug.

To reproduce: compile ghc-regress/lib/should_run/memo002 with
profiling and run it with a sufficiently small sample interval (-i0.02
did it for me).

Thanks to the kind folks at ARM for helping out with the debugging of
this one.

MERGE TO STABLE

21 years ago[project @ 2002-10-31 14:10:40 by simonpj]
simonpj [Thu, 31 Oct 2002 14:10:40 +0000 (14:10 +0000)]
[project @ 2002-10-31 14:10:40 by simonpj]
Print implicit types and bindings in External Core

21 years ago[project @ 2002-10-31 13:13:04 by simonpj]
simonpj [Thu, 31 Oct 2002 13:13:05 +0000 (13:13 +0000)]
[project @ 2002-10-31 13:13:04 by simonpj]
Finish TH exprs with type sigs

21 years ago[project @ 2002-10-30 13:16:40 by simonpj]
simonpj [Wed, 30 Oct 2002 13:17:06 +0000 (13:17 +0000)]
[project @ 2002-10-30 13:16:40 by simonpj]
Add string/rational literals, and e::t form to TH

21 years ago[project @ 2002-10-30 11:23:28 by simonpj]
simonpj [Wed, 30 Oct 2002 11:23:28 +0000 (11:23 +0000)]
[project @ 2002-10-30 11:23:28 by simonpj]
Remove CrossStage from Convert

21 years ago[project @ 2002-10-30 09:29:33 by simonpj]
simonpj [Wed, 30 Oct 2002 09:29:33 +0000 (09:29 +0000)]
[project @ 2002-10-30 09:29:33 by simonpj]
Fix an obscure record-selector-in-newtype bug

21 years ago[project @ 2002-10-30 05:46:48 by chak]
chak [Wed, 30 Oct 2002 05:46:49 +0000 (05:46 +0000)]
[project @ 2002-10-30 05:46:48 by chak]
Added support for negation to THSyntax and DsMeta.repE.

21 years ago[project @ 2002-10-29 17:56:58 by simonpj]
simonpj [Tue, 29 Oct 2002 17:56:58 +0000 (17:56 +0000)]
[project @ 2002-10-29 17:56:58 by simonpj]
Oops... add missing free-vars

21 years ago[project @ 2002-10-29 15:48:25 by sof]
sof [Tue, 29 Oct 2002 15:48:25 +0000 (15:48 +0000)]
[project @ 2002-10-29 15:48:25 by sof]
err msg wibble

21 years ago[project @ 2002-10-29 15:43:12 by simonmar]
simonmar [Tue, 29 Oct 2002 15:43:12 +0000 (15:43 +0000)]
[project @ 2002-10-29 15:43:12 by simonmar]
Add a note about where the time spent in foreign code is attributed.

21 years ago[project @ 2002-10-29 13:16:46 by chak]
chak [Tue, 29 Oct 2002 13:16:46 +0000 (13:16 +0000)]
[project @ 2002-10-29 13:16:46 by chak]
Cleaned up `repE'.  Reordered to match order of cases in HsExpr and made an
effort to catch all cases.

21 years ago[project @ 2002-10-29 11:58:28 by simonpj]
simonpj [Tue, 29 Oct 2002 11:58:28 +0000 (11:58 +0000)]
[project @ 2002-10-29 11:58:28 by simonpj]
Wibble to lint-ing unfoldings

21 years ago[project @ 2002-10-29 11:57:41 by chak]
chak [Tue, 29 Oct 2002 11:57:41 +0000 (11:57 +0000)]
[project @ 2002-10-29 11:57:41 by chak]
Added a case for HsPar to repE.  Also completed the cases in repE to at
least panic for the missing syntactic forms of HsExpr.

Is there any good reason for the semi-random order of the cases in repE?
Using the same order as in the data declaration for HsExpr would make it
easier to spot missing cases.

21 years ago[project @ 2002-10-29 10:53:42 by simonpj]
simonpj [Tue, 29 Oct 2002 10:53:42 +0000 (10:53 +0000)]
[project @ 2002-10-29 10:53:42 by simonpj]
Slight tidy up

21 years ago[project @ 2002-10-29 10:50:53 by simonpj]
simonpj [Tue, 29 Oct 2002 10:50:54 +0000 (10:50 +0000)]
[project @ 2002-10-29 10:50:53 by simonpj]
Make imports work for pre-504

21 years ago[project @ 2002-10-29 04:00:59 by mthomas]
mthomas [Tue, 29 Oct 2002 04:01:01 +0000 (04:01 +0000)]
[project @ 2002-10-29 04:00:59 by mthomas]
Remove unnecessary compiler and linker flags for Mingw32.

21 years ago[project @ 2002-10-28 11:21:13 by simonpj]
simonpj [Mon, 28 Oct 2002 11:21:14 +0000 (11:21 +0000)]
[project @ 2002-10-28 11:21:13 by simonpj]
Track locations for binders better (fixes several rn and mod failures)

21 years ago[project @ 2002-10-28 10:11:17 by simonpj]
simonpj [Mon, 28 Oct 2002 10:11:17 +0000 (10:11 +0000)]
[project @ 2002-10-28 10:11:17 by simonpj]
Use getExecDir, just like in ghc-pkg and SysTools

21 years ago[project @ 2002-10-28 09:52:14 by simonpj]
simonpj [Mon, 28 Oct 2002 09:52:14 +0000 (09:52 +0000)]
[project @ 2002-10-28 09:52:14 by simonpj]
Fix bogon in linker

21 years ago[project @ 2002-10-27 21:47:36 by wolfgang]
wolfgang [Sun, 27 Oct 2002 21:47:36 +0000 (21:47 +0000)]
[project @ 2002-10-27 21:47:36 by wolfgang]
Fix a type and a bug for PowerPC.

21 years ago[project @ 2002-10-27 21:46:27 by wolfgang]
wolfgang [Sun, 27 Oct 2002 21:46:27 +0000 (21:46 +0000)]
[project @ 2002-10-27 21:46:27 by wolfgang]
For Mac OS X, use the underlying Mach Microkernel calls instead of mmap.
Darwin's mmap doesn't honor the passed-in address without MAP_FIXED,
and MAP_FIXED replaces all existing mappings, so it can't be used.

21 years ago[project @ 2002-10-27 10:38:32 by mthomas]
mthomas [Sun, 27 Oct 2002 10:38:33 +0000 (10:38 +0000)]
[project @ 2002-10-27 10:38:32 by mthomas]
Remove Win32 library dependency.

21 years ago[project @ 2002-10-25 21:59:51 by simonpj]
simonpj [Fri, 25 Oct 2002 21:59:52 +0000 (21:59 +0000)]
[project @ 2002-10-25 21:59:51 by simonpj]
Put findLinkable in Finder.lhs, where it can be found in non-ghci stage1 compilers!

21 years ago[project @ 2002-10-25 21:58:24 by simonpj]
simonpj [Fri, 25 Oct 2002 21:58:24 +0000 (21:58 +0000)]
[project @ 2002-10-25 21:58:24 by simonpj]
Import wibbles

21 years ago[project @ 2002-10-25 16:54:55 by simonpj]
simonpj [Fri, 25 Oct 2002 16:55:00 +0000 (16:55 +0000)]
[project @ 2002-10-25 16:54:55 by simonpj]
Import wibbles

21 years ago[project @ 2002-10-25 15:57:03 by simonpj]
simonpj [Fri, 25 Oct 2002 15:57:03 +0000 (15:57 +0000)]
[project @ 2002-10-25 15:57:03 by simonpj]
Reduce exports, and add comments

21 years ago[project @ 2002-10-25 15:23:03 by simonpj]
simonpj [Fri, 25 Oct 2002 15:23:07 +0000 (15:23 +0000)]
[project @ 2002-10-25 15:23:03 by simonpj]
------------------------
More dependency fiddling
------------------------

WARNING: Interface file format has changed (again)
 You need to 'make clean' in all library code

* Orphan modules are now kept separately
  Home-package dependencies now contain only home-package dependencies!
  See HscTypes.Dependencies

* Linker now uses the dependencies to do dynamic linking

Result: Template Haskell should work even without --make (not yet tested)

21 years ago[project @ 2002-10-25 12:56:34 by simonmar]
simonmar [Fri, 25 Oct 2002 12:56:34 +0000 (12:56 +0000)]
[project @ 2002-10-25 12:56:34 by simonmar]
We shouldn't be using MAP_FIXED on solaris (fixes last night's crash).

Unfortunately on Solaris the heuristics don't work too well.  Solaris
seems to ignore the addr argument to mmap when MAP_FIXED is not
specified, and starts handing out memory from the top of the address
space.  So we allocate 2M each time and munmap() ends to leave an
aligned 1M chunk.  This will eventually leave the address space
completely full of 1M holes.  I don't have a good solution to this at
the moment.

MERGE TO STABLE

21 years ago[project @ 2002-10-25 12:34:12 by michaelw]
michaelw [Fri, 25 Oct 2002 12:34:12 +0000 (12:34 +0000)]
[project @ 2002-10-25 12:34:12 by michaelw]
* typo (dl -> dnl)

21 years ago[project @ 2002-10-25 11:33:27 by simonpj]
simonpj [Fri, 25 Oct 2002 11:33:27 +0000 (11:33 +0000)]
[project @ 2002-10-25 11:33:27 by simonpj]
Wibble; cures failure in stage2 build

21 years ago[project @ 2002-10-25 09:40:47 by simonmar]
simonmar [Fri, 25 Oct 2002 09:40:47 +0000 (09:40 +0000)]
[project @ 2002-10-25 09:40:47 by simonmar]
In eval_thunk_selector(), don't follow IND_STATICs because they might
lead us into to-space.  Fixes a case of "EVACUATED object entered!".

Also, add an assertion to catch this bug earlier.

MERGE TO STABLE

21 years ago[project @ 2002-10-24 16:54:19 by simonpj]
simonpj [Thu, 24 Oct 2002 16:54:19 +0000 (16:54 +0000)]
[project @ 2002-10-24 16:54:19 by simonpj]
Uh oh; got the versioning stuff a bit wrong in the last commit

21 years ago[project @ 2002-10-24 14:17:46 by simonpj]
simonpj [Thu, 24 Oct 2002 14:17:53 +0000 (14:17 +0000)]
[project @ 2002-10-24 14:17:46 by simonpj]
------------------------------------------
1. New try and module and package dependencies
2. OrigNameCache always contains final info
------------------------------------------

These things nearly complete sorting out the incremental
linking problem that started us off!

1. This commit separates two kinds of information:

  (a) HscTypes.Dependencies:
What (i)  home-package modules, and
     (ii) other packages
      this module depends on, transitively.

      That is, to link the module, it should be enough
      to link the dependent modules and packages (plus
      any C stubs etc).

      Along with this info we record whether the dependent module
      is (a) a boot interface or (b) an orphan module.  So in
      fact (i) can contain non-home-package modules, namely the
      orphan ones in other packages (sigh).

  (b) HscTypes.Usage:
      What version of imported things were used to
      actually compile the module.  This info is used for
      recompilation control only.

2. The Finder now returns a correct Module (incl package indicator)
first time, so we can install the absolutely final Name in the
OrigNameCache when we first come across an occurrence of that name,
even if it's only an occurrence in an unfolding in some other interface
file.  This is much tidier.

As a result Module.lhs is much cleaner
No DunnoYet
No mkVanillaModule
ALl very joyful stuff.

21 years ago[project @ 2002-10-24 13:08:35 by simonmar]
simonmar [Thu, 24 Oct 2002 13:08:35 +0000 (13:08 +0000)]
[project @ 2002-10-24 13:08:35 by simonmar]
In --make mode, consider everything that doesn't contain a '.' to be a
compilation manager input.  This fixes cases like

  ghc --make test37

where test37.hs exists.  I broke this in the previous commit, causing
a number of tests to break.

21 years ago[project @ 2002-10-23 15:56:39 by simonpj]
simonpj [Wed, 23 Oct 2002 15:56:39 +0000 (15:56 +0000)]
[project @ 2002-10-23 15:56:39 by simonpj]
Document implicit parameter bindings

21 years ago[project @ 2002-10-23 14:30:00 by simonpj]
simonpj [Wed, 23 Oct 2002 14:30:03 +0000 (14:30 +0000)]
[project @ 2002-10-23 14:30:00 by simonpj]
------------------------------------------------
Allow implicit-parameter bindings anywhere that
a normal binding group is allowed.
------------------------------------------------

That is, you can have implicit parameters

* in a let binding
* in a where clause (but then you can't have non-implicit
  ones as well)
* in a let group in a list comprehension or monad do-notation

The implementation is simple: just add IPBinds to the allowable forms of HsBinds,
and remove the HsWith expression form altogether.   (It now comes in via the
HsLet form.)

It'a a nice generalisation really.  Needs a bit of documentation, which I'll do next.

21 years ago[project @ 2002-10-23 12:26:11 by mthomas]
mthomas [Wed, 23 Oct 2002 12:26:11 +0000 (12:26 +0000)]
[project @ 2002-10-23 12:26:11 by mthomas]
Declare loop index i.

21 years ago[project @ 2002-10-23 08:52:26 by simonmar]
simonmar [Wed, 23 Oct 2002 08:52:26 +0000 (08:52 +0000)]
[project @ 2002-10-23 08:52:26 by simonmar]
Add atomicModifyIORefzh_fast symbol (should have been done with the
rest of the atomicModifyIORef# commit, thanks to Manuel Chakravarty
for pointing out the problem).

21 years ago[project @ 2002-10-23 02:36:37 by chak]
chak [Wed, 23 Oct 2002 02:36:37 +0000 (02:36 +0000)]
[project @ 2002-10-23 02:36:37 by chak]
Added an import to make TH compile.

21 years ago[project @ 2002-10-22 13:36:56 by simonmar]
simonmar [Tue, 22 Oct 2002 13:36:56 +0000 (13:36 +0000)]
[project @ 2002-10-22 13:36:56 by simonmar]
Fix recent FreeBSD breakage in the mangler: the "Prologue Junk" test
was a little bit too strict about whitespace.

21 years ago[project @ 2002-10-22 11:01:18 by simonmar]
simonmar [Tue, 22 Oct 2002 11:01:20 +0000 (11:01 +0000)]
[project @ 2002-10-22 11:01:18 by simonmar]
change the types of cmp_thread, rts_getThreadId, and labelThread to
take StgPtr rather than StgTSO *, since the compiler now has no
distinction between these two types in the back end.

I also noticed that labelThread need not be a primitive: it could just
as well be a normal C function called by the FFI, but I haven't made
that change.

21 years ago[project @ 2002-10-22 10:31:21 by simonpj]
simonpj [Tue, 22 Oct 2002 10:31:21 +0000 (10:31 +0000)]
[project @ 2002-10-22 10:31:21 by simonpj]
Import wibbles

21 years ago[project @ 2002-10-21 12:42:31 by simonmar]
simonmar [Mon, 21 Oct 2002 12:42:31 +0000 (12:42 +0000)]
[project @ 2002-10-21 12:42:31 by simonmar]
Turn an instance of 0xfff00000 into ~MBLOCK_MASK in the Win32 code.

21 years ago[project @ 2002-10-21 11:38:53 by simonmar]
simonmar [Mon, 21 Oct 2002 11:38:54 +0000 (11:38 +0000)]
[project @ 2002-10-21 11:38:53 by simonmar]
Bite the bullet and generalise the central memory allocation scheme.
Previously we tried to allocate memory starting from a fixed address,
which was set for each architecture (0x5000000 was a common one), and
to decide whether a particular address was in the heap or not we would
do a simple comparison against this address.

This doesn't work too well, because:

 - if we dynamically-load some objects above the boundary, the
   heap-allocated test becomes invalid

 - on windows we have less control, and the heap might be
   split into multiple sections

 - it turns out that on some Linux kernels we don't get memory where
   we asked for it.  This might be a bug in those kernels, but it
   exposes the fragility of our allocation scheme.

The solution is to bite the bullet and maintain a table mapping
addresses to a value indicating whether that address is in the heap or
not.  Since we normally allocate heap in chunks of 1Mb, the table is
quite small: 4k on a 32-bit machine, using one byte for each 1Mb
block.  Testing an address for heap residency now involves a memory
access, but the table is normally cache-resident.  I didn't manage to
measure any slowdown after making the change.

On a 64-bit machine, we'll need to use a 2-level table; I haven't
implemented that yet.

Now we can generalise the procedure used to grab memory from the OS.
In the general case, we allocate one megablock more than we need to,
and trim off the slop around the allocation to leave an aligned chunk.
The next time around, however, we try to allocate memory right after
the last chunk allocated, on the grounds that it is aligned and
probably free: if this doesn't work, we have to back off to the
general mechanism (it seems to work most of the time).

This cleans up the Windows story too: is_heap_alloced() has gone, and
we should be able to handle more than 256M of memory (or whatever the
arbitrary limit was before).

MERGE TO STABLE (after lots of testing)

21 years ago[project @ 2002-10-19 10:42:23 by stolz]
stolz [Sat, 19 Oct 2002 10:42:24 +0000 (10:42 +0000)]
[project @ 2002-10-19 10:42:23 by stolz]
Retro Police: There are hosts w/o in_addr_t (e.g. SuSE 7.0)

21 years ago[project @ 2002-10-18 13:41:50 by simonpj]
simonpj [Fri, 18 Oct 2002 13:41:55 +0000 (13:41 +0000)]
[project @ 2002-10-18 13:41:50 by simonpj]
--------------------------------
   Fix a serious error in the "newtype deriving" feature
--------------------------------

The "newtype deriving" feature lets you derive arbitrary classes for
a newtype, not just the built-in ones (Read, Show, Ix etc).  It's very
cool, but Hal Duame discovered that it did utterly the Wrong Thing
for superclasses.  E.g.

newtype Foo = MkFoo Int deriving( Show, Num, Eq )

You'd get a Num instance for Foo that was *identical* to the
Num instance for Int, *including* the Show superclass. So the
superclass in the Num dictionary would show a Foo just like an
Int, which is wrong... it should show as "Foo n".

This commit fixes the problem, by building a new dictionary every time,
but using the methods from the dictionary for the representation type.

I also fixed a bug that prevented it working altogether when the
representation type was not the application of a type constructor.
For example, this now works

newtype Foo a = MkFoo a deriving( Num, Eq, Show )

I also made it a bit more efficient in the case where the type is
not parameterised.  Then the "dfun" doesn't need to be a function.

21 years ago[project @ 2002-10-18 13:36:17 by simonpj]
simonpj [Fri, 18 Oct 2002 13:36:17 +0000 (13:36 +0000)]
[project @ 2002-10-18 13:36:17 by simonpj]
Add a trace

21 years ago[project @ 2002-10-18 13:35:46 by simonpj]
simonpj [Fri, 18 Oct 2002 13:35:47 +0000 (13:35 +0000)]
[project @ 2002-10-18 13:35:46 by simonpj]
Import wibbles

21 years ago[project @ 2002-10-18 10:16:04 by simonmar]
simonmar [Fri, 18 Oct 2002 10:16:04 +0000 (10:16 +0000)]
[project @ 2002-10-18 10:16:04 by simonmar]
Add the Haskell Web Server to the fptools repository so I can give it
a proper license.

21 years ago[project @ 2002-10-18 09:51:03 by simonmar]
simonmar [Fri, 18 Oct 2002 09:51:04 +0000 (09:51 +0000)]
[project @ 2002-10-18 09:51:03 by simonmar]
Add atomicModifyIORef, as discussed on the FFI list.

21 years ago[project @ 2002-10-18 09:36:21 by simonmar]
simonmar [Fri, 18 Oct 2002 09:36:21 +0000 (09:36 +0000)]
[project @ 2002-10-18 09:36:21 by simonmar]
Add a note about the profiling versions of the interface files in a package.

21 years ago[project @ 2002-10-17 14:49:52 by simonmar]
simonmar [Thu, 17 Oct 2002 14:49:52 +0000 (14:49 +0000)]
[project @ 2002-10-17 14:49:52 by simonmar]
- Don't flush the finder cache after adding a new package.  We'll
  assume that packages don't overlap.

- Add the extra command-line flags specified by a package when we
  add a package from the GHCi prompt.

21 years ago[project @ 2002-10-17 14:26:16 by simonmar]
simonmar [Thu, 17 Oct 2002 14:26:19 +0000 (14:26 +0000)]
[project @ 2002-10-17 14:26:16 by simonmar]
Finder overhaul.

The finder had got pretty complicated; this commit is mainly a
cleanup, with one new feature:

  - the finder has a cache (again).  The cache may be flushed by
    calling flushFinderCache, which actually only flushes home modules
    from the cache, because package modules are assumed not to move.
    This change is apropos of some other changes which will result in
    the finder being called more often, so we think a cache is going
    to be worthwhile.

Also a couple of bugs were fixed:

  - the field ml_hi_file in a ModLocation is now *always* the name
    of the .hi file.  If you need a .hi-boot file, you have to make
    it up by changing the suffix of ml_hi_file.  (DriverMkDepend and
    RnHiFiles do this).  This was the cause of a bug, but I can't
    remember the details.

  - The -odir flag now works in a more reasonable way: hierarchical
    modules get put in subdirectories of the -odir directory.  eg.
    if your module is A.B.C, and -odir D is specified, then the object
    will be D/A/B/C.o; previously it would have been D/C.o.

21 years ago[project @ 2002-10-15 13:20:18 by simonmar]
simonmar [Tue, 15 Oct 2002 13:20:18 +0000 (13:20 +0000)]
[project @ 2002-10-15 13:20:18 by simonmar]
beginMake: separate out compilation-manager inputs from linkable
objects in a way that is more consistent with the one-shot compilation
mode.  Specifically, we now pass anything that looks like a module
name or a Haskell source filename to the compilation manager, and
everything else to the linker.

MERGE TO STABLE

21 years ago[project @ 2002-10-15 13:18:51 by simonmar]
simonmar [Tue, 15 Oct 2002 13:18:51 +0000 (13:18 +0000)]
[project @ 2002-10-15 13:18:51 by simonmar]
Remove looksLikeModuleName, it is defined in Util now.

21 years ago[project @ 2002-10-15 13:17:40 by simonmar]
simonmar [Tue, 15 Oct 2002 13:17:40 +0000 (13:17 +0000)]
[project @ 2002-10-15 13:17:40 by simonmar]
Move looksLikeModuleName here from InterativeUI, so we can use it elsewhere.

21 years ago[project @ 2002-10-15 12:56:03 by simonmar]
simonmar [Tue, 15 Oct 2002 12:56:03 +0000 (12:56 +0000)]
[project @ 2002-10-15 12:56:03 by simonmar]
wibble

21 years ago[project @ 2002-10-15 12:38:30 by simonmar]
simonmar [Tue, 15 Oct 2002 12:38:30 +0000 (12:38 +0000)]
[project @ 2002-10-15 12:38:30 by simonmar]
wibble

21 years ago[project @ 2002-10-15 12:04:05 by simonmar]
simonmar [Tue, 15 Oct 2002 12:04:05 +0000 (12:04 +0000)]
[project @ 2002-10-15 12:04:05 by simonmar]
Don't use stdPackage (it has gone)

21 years ago[project @ 2002-10-15 11:52:31 by simonpj]
simonpj [Tue, 15 Oct 2002 11:52:32 +0000 (11:52 +0000)]
[project @ 2002-10-15 11:52:31 by simonpj]
------------------------------------------------
Fix exports for a module with  no local bindings
------------------------------------------------

Fix the export-list generation for a module with no local bindings.
This one bug was breaking a bunch of modxxx tests, plus some renamer
test, plus a desugarer test.

21 years ago[project @ 2002-10-15 11:02:32 by simonmar]
simonmar [Tue, 15 Oct 2002 11:02:32 +0000 (11:02 +0000)]
[project @ 2002-10-15 11:02:32 by simonmar]
Slight fix to the allocated memory calculation

21 years ago[project @ 2002-10-15 11:01:29 by simonmar]
simonmar [Tue, 15 Oct 2002 11:01:29 +0000 (11:01 +0000)]
[project @ 2002-10-15 11:01:29 by simonmar]
Don't need to export Exception.try or Exception.throwDyn here.

21 years ago[project @ 2002-10-15 11:00:37 by simonmar]
simonmar [Tue, 15 Oct 2002 11:00:37 +0000 (11:00 +0000)]
[project @ 2002-10-15 11:00:37 by simonmar]
Use Panic.tryMost rather than Exception.try, since we don't want to
catch ^C and panic exceptions.

21 years ago[project @ 2002-10-15 10:59:38 by simonmar]
simonmar [Tue, 15 Oct 2002 10:59:38 +0000 (10:59 +0000)]
[project @ 2002-10-15 10:59:38 by simonmar]
Remove unused 'stdPackage'

21 years ago[project @ 2002-10-15 10:53:21 by simonmar]
simonmar [Tue, 15 Oct 2002 10:53:21 +0000 (10:53 +0000)]
[project @ 2002-10-15 10:53:21 by simonmar]
Remove the "contributors" section herein an point the interested
reader to the contributors list on the web site which is much more
up-to-date.

21 years ago[project @ 2002-10-15 08:56:50 by simonpj]
simonpj [Tue, 15 Oct 2002 08:56:55 +0000 (08:56 +0000)]
[project @ 2002-10-15 08:56:50 by simonpj]
Some reorganising.  Simon and I agreed to leave out most of the (inaccurate) section
on primitive operations, pointing people instead to the Real Truth in primops.txt
and the External Core document.

Also: bugs section added

21 years ago[project @ 2002-10-14 15:50:14 by sof]
sof [Mon, 14 Oct 2002 15:50:14 +0000 (15:50 +0000)]
[project @ 2002-10-14 15:50:14 by sof]
make it compile again (x86)

21 years ago[project @ 2002-10-14 14:54:16 by simonmar]
simonmar [Mon, 14 Oct 2002 14:54:16 +0000 (14:54 +0000)]
[project @ 2002-10-14 14:54:16 by simonmar]
Put stdin back into non-blocking mode after calling readline, because
readline sometimes clears the O_NONBLOCK flag (done using the
GHC.Posix interface, so it shouldn't break Win32).