1. 23 Sep, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-09-23 14:32:57 by simonmar] · abbc5a0b
      simonmar authored
      - 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 '!!'.
      abbc5a0b
  2. 04 Sep, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-09-04 11:08:46 by simonmar] · e98cf284
      simonmar authored
      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).
      e98cf284
  3. 27 Aug, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-08-27 12:29:21 by simonmar] · 8a45d6bb
      simonmar authored
      Always display the prompt if verbosity > 0, previously it was only
      displayed if stdin was a tty.  This fixes problems with running GHCi
      under Emacs, which expects to see a prompt.
      8a45d6bb
  4. 21 Jul, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-07-21 14:33:19 by simonmar] · 95f1b72e
      simonmar authored
      :cd now causes all modules to be unloaded.
      
      This is the easy fix for a problem whereby changing directories will
      cause GHC to try to demand-load objects from the wrong place, because
      it is using relative pathnames.
      
      It's not obvious what the "right" thing to do is if the user changes
      directory with :cd and then does a :reload.  Perhaps the right thing
      to do is to make the search path "sticky", so that it stays relative
      to the original current directory.  This would probably require some
      re-engineering of GHC to only use absolute paths internally.
      95f1b72e
  5. 02 Jul, 2003 2 commits
  6. 21 May, 2003 1 commit
  7. 19 May, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-05-19 15:39:17 by simonpj] · 7f480764
      simonpj authored
      ---------------------------------
      	Improve the dynamic-linking story
      	---------------------------------
      
      Arrange proper initialisation for the dynamic linker.  Whenever the dynamic linker does
      anything (Linker.linkExpr), it first initialises itself, arranging to only do so once
      of course.
      
      "Initialising itself" includes loading any .o files, libraries, and packages specified
      on the command line.  The main effect of all this is to fix a Template Haskell problem,
      which happened when a TH link needed some C library that it couldn't link.  Now it does.
      
      
      
      While I was at it, I tidied up main/Main.hs quite a bit.  This is a delicate area (handling
      the command line arguments), but I don't believe I broke anything!  All the libraries
      build, and lots of tests run.
      
      Wolfgang: I also jiggled the darwin_TARGET_OS stuff a little in Linker.lhs, but again
      I think the net effect is zero. You might want to check.
      7f480764
  8. 07 May, 2003 1 commit
  9. 23 Apr, 2003 1 commit
  10. 12 Apr, 2003 1 commit
  11. 03 Mar, 2003 1 commit
  12. 24 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-24 12:39:24 by simonpj] · 395917a0
      simonpj authored
      Three Template Haskell improvements
      
      a) Add type synonyms to THSyntax (and DsMeta, Convert)
      
      b) Make Q into a newtype instead of a type synonym
      
      c) Eliminate tiresome and error prone argument to DsMeta.wrapGenSyms
         and similarly addTyVarBinds
      395917a0
  13. 20 Feb, 2003 1 commit
  14. 19 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-19 15:54:05 by simonpj] · 3355c9d5
      simonpj authored
      -------------------------------------
      	 	Two minor wibbles
      	-------------------------------------
      
      
      1.  Make the generic toT/fromT Ids for "generic derived classes" into
          proper ImplicitIds, with their own GlobalIdDetails. This makes it
          easier to identify them.  (The lack of this showed up as a bug
          when I made an apparently-innocuous other change.)
      
      2.  Distinguish ClassOpIds from RecordSelIds in their GlobalIdDetails.
          They are treated differently here and there, so I made this change
          as part of (1)
      
      3.  Ensure that a declaration quotation [d| ... |] does not have a
          permanent effect on the instance environment. (A TH fix.)
      3355c9d5
  15. 17 Feb, 2003 1 commit
  16. 13 Feb, 2003 1 commit
    • sof's avatar
      [project @ 2003-02-13 01:50:04 by sof] · d3b10fea
      sof authored
      Be sensitive to filenames containing spaces when processing
      :load & :add commands. Ditto when interpreting filenames given
      on GHCi's cmd-line.
      
      Merge to STABLE.
      d3b10fea
  17. 12 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-12 15:01:31 by simonpj] · 42b63073
      simonpj authored
      -------------------------------------
        Big upheaval to the way that constructors are named
      	-------------------------------------
      
      This commit enshrines the new story for constructor names.  We could never
      really get External Core to work nicely before, but now it does.
      
      The story is laid out in detail in the Commentary
      	ghc/docs/comm/the-beast/data-types.html
      so I will not repeat it here.
      
      	[Manuel: the commentary isn't being updated, apparently.]
      
      However, the net effect is that in Core and in External Core, contructors look
      like constructors, and the way things are printed is all consistent.
      
      It is a fairly pervasive change (which is why it has been so long postponed),
      but I hope the question is now finally closed.
      
      All the libraries compile etc, and I've run many tests, but doubtless there will
      be some dark corners.
      42b63073
  18. 27 Dec, 2002 1 commit
    • panne's avatar
      [project @ 2002-12-27 12:20:06 by panne] · 24a7d2d2
      panne authored
      -#include cleanup. What we really need here are additional prototypes
      for 'getAllocations' and 'revertCAFs', but these are only available
      via RTS headers. I'm not sure if -#including them somehow would be OK,
      so I left this out. A few lines of documentation who is allowed to
      #include (or -#include) what would be helpful...
      24a7d2d2
  19. 19 Dec, 2002 2 commits
  20. 12 Dec, 2002 1 commit
  21. 05 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-05 12:36:54 by simonmar] · 6dda11d0
      simonmar authored
      Don't put a recursive exception handler around the flushing of
      stdout/stderr after running a command.  If the user closes stdout or
      stderr, we now fail rather than going into an infinite loop.
      6dda11d0
  22. 17 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-17 14:49:52 by simonmar] · f9449b97
      simonmar authored
      - 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.
      f9449b97
  23. 15 Oct, 2002 1 commit
  24. 14 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-14 14:54:16 by simonmar] · 3312cb59
      simonmar authored
      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).
      3312cb59
  25. 13 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4
  26. 06 Sep, 2002 1 commit
  27. 29 Aug, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-08-29 15:44:11 by simonmar] · ce9687a5
      simonmar authored
      Housekeeping:
      
        - The main goal is to remove dependencies on hslibs for a
          bootstrapped compiler, leaving only a requirement that the
          packages base, haskell98 and readline are built in stage 1 in
          order to bootstrap.  We're almost there: Posix is still required
          for signal handling, but all other dependencies on hslibs are now
          gone.
      
          Uses of Addr and ByteArray/MutableByteArray array are all gone
          from the compiler.  PrimPacked defines the Ptr type for GHC 4.08
          (which didn't have it), and it defines simple BA and MBA types to
          replace uses of ByteArray and MutableByteArray respectively.
      
        - Clean up import lists.  HsVersions.h now defines macros for some
          modules which have moved between GHC versions.  eg. one now
          imports 'GLAEXTS' to get at unboxed types and primops in the
          compiler.
      
          Many import lists have been sorted as per the recommendations in
          the new style guidelines in the commentary.
      
      I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
      itself, and everything still works here.  Doubtless I've got something
      wrong, though.
      ce9687a5
  28. 05 Aug, 2002 1 commit
  29. 26 Jul, 2002 1 commit
    • sof's avatar
      [project @ 2002-07-26 03:06:58 by sof] · 6b269a43
      sof authored
      interactiveLoop{mingw32}: always show prompt under mingw.
      
      hIsTerminalDevice returns True iff stdin is connected to a Console
      under Win32. Which it is when running in a command shell
      (DOS,bash etc.), but Emacs sub-shells don't get a Console of their
      own when invoked. So, just disable this feature (whose motivation
      somewhat escapes me.)
      6b269a43
  30. 17 Jul, 2002 1 commit
  31. 02 Jul, 2002 2 commits
  32. 12 Jun, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-06-12 22:04:25 by wolfgang] · 643a2f70
      wolfgang authored
      Added support for Frameworks on MacOS X.
      *) On MacOS X, two additional command-line options are supported:
      -framework <FRAMEWORK>    link with framework, gets passed on to ld
      -framework-path <PATH>    gets passed on to ld as "-F<PATH>". (-F is already taken for GHC).
      *) Two corresponding additional options for package.conf files:
      framework_dirs
      extra_frameworks
      These options are allowed on any platform. They are ignored everywhere except on MacOS X.
      *) ghc-pkg no longer uses Read. Instead, it uses a Happy parser. ghc/utils/ghc-pkg/ParsePkgConfLite.y is basically a copy of ghc/compiler/main/ParsePkgConf.y. "Light" refers to the fact that it doesn't depend on other GHC modules and has less sophisticated error reporting.
      *) Frameworks will need some additional work for GHCi.
      643a2f70
  33. 04 Jun, 2002 1 commit
  34. 01 May, 2002 3 commits
    • sof's avatar
      [project @ 2002-05-01 17:56:52 by sof] · 2ac92d88
      sof authored
      mapM ~> mapM_
      2ac92d88
    • simonmar's avatar
      [project @ 2002-05-01 15:48:48 by simonmar] · 80082734
      simonmar authored
      Clean up the code to load a dynamic library some more and hopefully
      make it work on Windows (untested).
      80082734
    • simonmar's avatar
      [project @ 2002-05-01 15:46:14 by simonmar] · 786db576
      simonmar authored
      Cleanup and overhaul the bogus dynamic library loading code in
      InteractiveUI.  Bugs fixed:
      
        - when linking in extra_libraries from a package,
          we now search library_paths in addition to the default
          dlopen() paths.
      
        - the path-searching machinery for dynamic libraries specified
          on the command line was broken, it didn't work unless the library
          was found on the first path in the list.
      786db576
  35. 24 Apr, 2002 1 commit