1. 13 Feb, 2002 18 commits
    • simonmar's avatar
      [project @ 2002-02-13 15:45:25 by simonmar] · eed458c7
      simonmar authored
      Packages that come in by way of -package-conf files override default
      packages (requested by Manuel Chakravarty).
      eed458c7
    • sof's avatar
      [project @ 2002-02-13 15:29:27 by sof] · 4e19ab1d
      sof authored
      Tweaks to the Windows section, in part. commented out
      the InstallShield section as it is no longer used.
      4e19ab1d
    • simonpj's avatar
      [project @ 2002-02-13 15:19:17 by simonpj] · 711e4d7a
      simonpj authored
      ----------------------------------
      	Do the Right Thing for TyCons where we
      	can't see all their constructors.
      	----------------------------------
      
      Inside a TyCon, three things can happen
      
      1. GHC knows all the constructors, and has them to hand.
         (Nowadays, there may be zero constructors.)
      
      2. GHC knows all the constructors, but has declined to slurp
         them all in, to avoid sucking in more declarations than
         necessary.  All we remember is the number of constructors,
         so we can get the return convention right.
      
      3. GHC doesn't know anything. This happens *only* for decls
         coming from .hi-boot files, where the programmer declines to
         supply a representation.
      
      Until now, these three cases have been conflated together.  Matters
      are worse now that a TyCon really can have zero constructors.  In
      fact, by confusing (3) with (1) we can actually generate bogus code.
      
      With this commit, the dataCons field of a TyCon is of type:
      
      data DataConDetails datacon
        = DataCons [datacon]	-- Its data constructors, with fully polymorphic types
      			-- A type can have zero constructors
      
        | Unknown		-- We're importing this data type from an hi-boot file
      			-- and we don't know what its constructors are
      
        | HasCons Int		-- In a quest for compilation speed we have imported
      			-- only the number of constructors (to get return
      			-- conventions right) but not the constructors themselves
      
      This says exactly what is going on.  There are lots of consequential small
      changes.
      711e4d7a
    • simonpj's avatar
      [project @ 2002-02-13 15:14:06 by simonpj] · e7030995
      simonpj authored
      --------------------------------------------
      	Fix a bugs in type inference for rank-N types
      	--------------------------------------------
      
      We discovered this bug when looking at type rules!
      
      1. When type checking (e :: sigma-ty), we must specialise sigma-ty,
         else we lose the invariant that tcMonoType has.
      
      2. In tcExpr_id, we should pass in a Hole tyvar not an ordinary tyvar.
      
      As usual, I moved some functions around in consequence.
      e7030995
    • simonmar's avatar
      [project @ 2002-02-13 15:07:59 by simonmar] · d113ae78
      simonmar authored
      Don't translate out negative (boxed) literals too early.
      d113ae78
    • simonmar's avatar
      [project @ 2002-02-13 14:52:43 by simonmar] · f405fb59
      simonmar authored
      Catch up with Haskell 98 revisions: allow sections like (++ x ++ y)
      and (3 + 4 +).
      f405fb59
    • simonpj's avatar
      [project @ 2002-02-13 14:14:09 by simonpj] · 726258fc
      simonpj authored
      ------------------------------
      	Fix the "occurs check" so that
      	it handles unifying a type variable
      	with a type scheme
      	------------------------------
      
      It's illegal to unify a type variable with a type scheme:
      
      	a  :=:  (forall b. b->b) -> Int
      
      But I wasn't detecting that properly.  Now, the same code
      that does the occurs check also looks for foralls.
      726258fc
    • simonpj's avatar
      [project @ 2002-02-13 14:05:50 by simonpj] · af93bb78
      simonpj authored
      Import wibbles
      af93bb78
    • simonmar's avatar
      [project @ 2002-02-13 12:17:48 by simonmar] · ab96f60d
      simonmar authored
      Add {-# OPTIONS -fno-implicit-prelude #-} to the top of GHC/PrimopWrappers.hs
      ab96f60d
    • simonmar's avatar
      [project @ 2002-02-13 11:51:40 by simonmar] · aa0db183
      simonmar authored
      - Detect presence of a POSIX-compatible regex interface in configure,
        and omit Text.Regex.Posix (and hence Text.Regex) if it is missing.
        ToDo: pull in a suitably-licensed implementation of POSIX regex
        to be used in the event that the system doesn't supply one.
      
      - Rename old HaveRegex to HaveGNURegex.
      aa0db183
    • simonmar's avatar
      [project @ 2002-02-13 10:45:28 by simonmar] · 27e90065
      simonmar authored
      Use --update-package rather than --remove-package followed by --add-package
      27e90065
    • simonmar's avatar
      [project @ 2002-02-13 10:40:24 by simonmar] · 9f66c841
      simonmar authored
      Fixes to SplitObjs: we now put the split object files in a
      subdirectory M_split/ rather than just M/, because the latter
      interacts badly with our hierarchical module structure.
      9f66c841
    • simonpj's avatar
      [project @ 2002-02-13 10:39:36 by simonpj] · 9b7de002
      simonpj authored
      -------------------------------
      	dosifyPath before opening files
      	-------------------------------
      
      If you call
      	hsc2hs foo/baz
      
      you get the amazing response:
      
      	'foo' is not recognized as an internal or external command,
      	operable program or batch file.
      
      On the other hand
      	hsc2hs foo\baz
      
      works fine.  Solution: call dosifyPath before opening or writing the file.
      
      
      Somehow we should make it less easy to trip up when doing file I/O on
      Windows.  And provide a library of path-manipulation primitives.
      9b7de002
    • sof's avatar
      [project @ 2002-02-13 08:48:06 by sof] · e289780e
      sof authored
      Revised implementation of multi-threaded callouts (and callins):
      
      - unified synchronisation story for threaded and SMP builds,
        following up on SimonM's suggestion. The following synchro
        variables are now used inside the Scheduler:
      
          + thread_ready_cond - condition variable that is signalled
            when a H. thread has become runnable (via the THREAD_RUNNABLE()
            macro) and there are available capabilities. Waited on:
               + upon schedule() entry (iff no caps. available).
      	 + when a thread inside of the Scheduler spots that there
      	   are no runnable threads to service, but one or more
      	   external call is in progress.
      	 + in resumeThread(), waiting for a capability to become
      	   available.
      
            Prior to waiting on thread_ready_cond, a counter rts_n_waiting_tasks
            is incremented, so that we can keep track of the number of
            readily available worker threads (need this in order to make
            an informed decision on whether or not to create a new thread
            when an external call is made).
      
      
          + returning_worker_cond - condition variable that is waited
            on by an OS thread that has finished executing and external
            call & now want to feed its result back to the H thread
            that made the call. Before doing so, the counter
            rts_n_returning_workers is incremented.
      
            Upon entry to the Scheduler, this counter is checked for &
            if it is non-zero, the thread gives up its capability and
            signals returning_worker_cond before trying to re-grab a
            capability. (releaseCapability() takes care of this).
      
          + sched_mutex - protect Scheduler data structures.
          + gc_pending_cond - SMP-only condition variable for signalling
            completion of GCs.
      
      - initial implementation of call-ins, i.e., multiple OS threads
        may concurrently call into the RTS without interfering with
        each other. Implementation uses cheesy locking protocol to
        ensure that only one OS thread at a time can construct a
        function application -- stop-gap measure until the RtsAPI
        is revised (as discussed last month) *and* a designated
        block is used for allocating these applications.
      
      - In the implementation of call-ins, the OS thread blocks
        waiting for an RTS worker thread to complete the evaluation
        of the function application. Since main() also uses the
        RtsAPI, provide a separate entry point for it (rts_mainEvalIO()),
        which avoids creating a separate thread to evaluate Main.main,
        that can be done by the thread exec'ing main() directly.
        [Maybe there's a tidier way of doing this, a bit ugly the
        way it is now..]
      
      
      There are a couple of dark corners that needs to be looked at,
      such as conditions for shutting down (and how) + consider what
      ought to happen when async I/O is thrown into the mix (I know
      what will happen, but that's maybe not what we want).
      
      Other than that, things are in a generally happy state & I hope
      to declare myself done before the week is up.
      e289780e
    • sof's avatar
      [project @ 2002-02-13 07:51:01 by sof] · 3470e75b
      sof authored
      removed taskNotAvailable(), taskAvailable() and getTaskCount() - simplified away
      3470e75b
    • sof's avatar
      [project @ 2002-02-13 07:48:18 by sof] · 7b9ff54a
      sof authored
      moved defn of RTS_SUPPORTS_THREADS from Rts.h to Stg.h
      7b9ff54a
    • sof's avatar
      [project @ 2002-02-13 07:47:41 by sof] · d1447bea
      sof authored
      uh, make that the StgTSOBlockReason enum
      d1447bea
    • sof's avatar
      [project @ 2002-02-13 07:46:42 by sof] · 5107d99f
      sof authored
      Add BlockedOnCCall to StgTSOBlockInfo enum
      5107d99f
  2. 12 Feb, 2002 13 commits
    • njn's avatar
      [project @ 2002-02-12 17:20:36 by njn] · ca590cdd
      njn authored
      Added note about the mangler removing unneeded SRTs.
      ca590cdd
    • simonmar's avatar
      [project @ 2002-02-12 16:55:22 by simonmar] · e50ff381
      simonmar authored
      Must add 'depend' before 'all' in the boot target so that we get
      dependencies in time.
      e50ff381
    • simonmar's avatar
      [project @ 2002-02-12 16:52:37 by simonmar] · 3f30b9fd
      simonmar authored
      This isn't needed any more
      3f30b9fd
    • simonmar's avatar
      [project @ 2002-02-12 15:45:46 by simonmar] · 70977366
      simonmar authored
      Use LIBOBJS rather than OBJS when building the GHCi library.
      70977366
    • sof's avatar
      [project @ 2002-02-12 15:39:49 by sof] · 9d037f55
      sof authored
      THREAD_RUNNABLE(): make available in threaded mode
      9d037f55
    • sof's avatar
      [project @ 2002-02-12 15:38:08 by sof] · a62d5cd2
      sof authored
      Snapshot (before heading into work):
      - thread_ready_aux_mutex is no more; use sched_mutex instead.
      - gc_pending_cond only used in SMP mode.
      - document the condition that thread_ready_cond captures.
      a62d5cd2
    • sof's avatar
      [project @ 2002-02-12 15:34:25 by sof] · 3fa80568
      sof authored
      - give rts_n_free_capabilities an interpretation
        in threaded mode (possible values: 0,1)
      - noFreeCapabilities() -? noCapabilities()
      3fa80568
    • simonmar's avatar
      [project @ 2002-02-12 15:17:13 by simonmar] · 2cc5b907
      simonmar authored
      Switch over to the new hierarchical libraries
      ---------------------------------------------
      
      This commit reorganises our libraries to use the new hierarchical
      module namespace extension.
      
      The basic story is this:
      
         - fptools/libraries contains the new hierarchical libraries.
           Everything in here is "clean", i.e. most deprecated stuff has
           been removed.
      
      	- fptools/libraries/base is the new base package
      	  (replacing "std") and contains roughly what was previously
      	  in std, lang, and concurrent, minus deprecated stuff.
      	  Things that are *not allowed* in libraries/base include:
      		Addr, ForeignObj, ByteArray, MutableByteArray,
      		_casm_, _ccall_, ``'', PrimIO
      
      	  For ByteArrays and MutableByteArrays we use UArray and
      	  STUArray/IOUArray respectively now.
      
      	  Modules previously called PrelFoo are now under
      	  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.
      
      	- fptools/libraries/haskell98 provides the Haskell 98 std.
      	  libraries (Char, IO, Numeric etc.) as a package.  This
      	  package is enabled by default.
      
      	- fptools/libraries/network is a rearranged version of
      	  the existing net package (the old package net is still
      	  available; see below).
      
      	- Other packages will migrate to fptools/libraries in
      	  due course.
      
           NB. you need to checkout fptools/libraries as well as
           fptools/hslibs now.  The nightly build scripts will need to be
           tweaked.
      
         - fptools/hslibs still contains (almost) the same stuff as before.
           Where libraries have moved into the new hierarchy, the hslibs
           version contains a "stub" that just re-exports the new version.
           The idea is that code will gradually migrate from fptools/hslibs
           into fptools/libraries as it gets cleaned up, and in a version or
           two we can remove the old packages altogether.
      
         - I've taken the opportunity to make some changes to the build
           system, ripping out the old hslibs Makefile stuff from
           mk/target.mk; the new package building Makefile code is in
           mk/package.mk (auto-included from mk/target.mk).
      
           The main improvement is that packages now register themselves at
           make boot time using ghc-pkg, and the monolithic package.conf
           in ghc/driver is gone.
      
           I've updated the standard packages but haven't tested win32,
           graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
           these packages may need some further tweaks, and they'll need
           pkg.conf.in files added.
      
         - Unfortunately all this rearrangement meant I had to bump the
           interface-file version and create a bunch of .hi-boot-6 files :-(
      2cc5b907
    • simonmar's avatar
      [project @ 2002-02-12 11:44:54 by simonmar] · 239e9471
      simonmar authored
      Fix bug in previous commit
      239e9471
    • simonmar's avatar
      [project @ 2002-02-12 09:43:08 by simonmar] · 505f84a8
      simonmar authored
      fromInt ==> fromIntegral
      505f84a8
    • sof's avatar
      [project @ 2002-02-12 05:01:26 by sof] · ccaf7057
      sof authored
      bring stuff in parallel/ into scope when running 'mkdependC'
      ccaf7057
    • sof's avatar
      [project @ 2002-02-12 04:49:13 by sof] · 45e237c1
      sof authored
      comment wibble
      45e237c1
    • chak's avatar
      [project @ 2002-02-12 03:52:08 by chak] · 2f874c4c
      chak authored
      This fixes a problem with the recent clean up in the parsing of type
      declarations.  The cleaned up version was correct by H98 (I think), but
      unfortunately won't compile the Prelude anymore.
      
      I made the definition a little bit more liberal as follows:
      - In `tycl_hdr' allow `gtycon' instead of just `tycon' for the defined type
        constructor.  This allows beyond H98 special syntax like "[]" etc as well as
        tycon ops in parenthesis.  Moreover, it allows qualified names, but the
        renamer flags the latter as errors.
      - Allow `gtycon' instead of only `qtycon' for the class name in definitions of
        the form `Eq a => T a' to avoid a whole list of s/r conflicts.  (I have *not*
        checked that the renamer flags misuse, but I would expect that it does.)
      
      ToDo: I think, the renamer should raise an error for all these additional
            forms *unless* -fglasgow-exts is given.
      
      In PrelBase, I needed to replace the infix notation by prefix notation in the
      definition of `:+:' and `:*:'.
      2f874c4c
  3. 11 Feb, 2002 9 commits