ghc-hetmet.git
20 years ago[project @ 2003-07-22 16:18:06 by simonmar]
simonmar [Tue, 22 Jul 2003 16:18:06 +0000 (16:18 +0000)]
[project @ 2003-07-22 16:18:06 by simonmar]
Commit an untested, but hopefully more workable and up-to-date version
of this script.

20 years ago[project @ 2003-07-22 16:11:26 by simonmar]
simonmar [Tue, 22 Jul 2003 16:11:26 +0000 (16:11 +0000)]
[project @ 2003-07-22 16:11:26 by simonmar]
Another cost-centre-restoring fix.  Restoring the cost centre in an
unboxed-tuple case alternative was using the wrong stack offset.

20 years ago[project @ 2003-07-22 14:51:50 by simonmar]
simonmar [Tue, 22 Jul 2003 14:51:50 +0000 (14:51 +0000)]
[project @ 2003-07-22 14:51:50 by simonmar]
When GhcUnregisterised=YES, we must tell genapply about it.

20 years ago[project @ 2003-07-22 14:24:57 by simonmar]
simonmar [Tue, 22 Jul 2003 14:24:57 +0000 (14:24 +0000)]
[project @ 2003-07-22 14:24:57 by simonmar]
Fix a nasty bug in eq_ufVar, which meant that unfoldings were
comparing equal when non-local names in the unfolding had changed,
which could lead to erroneously avoiding recompilation.

This bug could cause bad behaviour along the lines of "my program was
segfaulting, but I did make clean; make and now it works!".

merge to STABLE

20 years ago[project @ 2003-07-22 13:23:44 by simonmar]
simonmar [Tue, 22 Jul 2003 13:23:44 +0000 (13:23 +0000)]
[project @ 2003-07-22 13:23:44 by simonmar]
Oops, move include of stdlib.h after MachRegs.h, so that it comes
after register variable declarations.

20 years ago[project @ 2003-07-21 15:24:42 by simonmar]
simonmar [Mon, 21 Jul 2003 15:24:43 +0000 (15:24 +0000)]
[project @ 2003-07-21 15:24:42 by simonmar]
Update the documentation for filenames and related options to reflect
the new story.  Now we talk about hierarchical modules from the
outset, and hopefully the whole description is somewhat clearer than
before.

20 years ago[project @ 2003-07-21 15:14:18 by ross]
ross [Mon, 21 Jul 2003 15:14:18 +0000 (15:14 +0000)]
[project @ 2003-07-21 15:14:18 by ross]
Check for unknown flags before (rather than after) checking -o and -ohi
flags, avoiding confusing behaviour like

% ghc -bad-option -c x.hs
ghc-6.0: unrecognised flags: -bad-option

% ghc -bad-option -c x.hs -ohi x.hi
ghc-6.0: -ohi can only be used when compiling a single source file
Usage: For basic information, try the `--help' option.

% ghc -bad-option -c x.hs -o x.o
ghc-6.0: can't apply -o to multiple source files
Usage: For basic information, try the `--help' option.

(looks better with scores of flags)

please merge to STABLE

20 years ago[project @ 2003-07-21 15:05:54 by simonmar]
simonmar [Mon, 21 Jul 2003 15:05:54 +0000 (15:05 +0000)]
[project @ 2003-07-21 15:05:54 by simonmar]
We use NULL in the headers (at least when -prof is on), so we better
#include <stdlib.h>.  We normally get it via HsBase.h anyway, but we
shouldn't rely on that.

20 years ago[project @ 2003-07-21 14:50:32 by simonmar]
simonmar [Mon, 21 Jul 2003 14:50:32 +0000 (14:50 +0000)]
[project @ 2003-07-21 14:50:32 by simonmar]
Document that changing directories unloads all modules.

20 years ago[project @ 2003-07-21 14:33:19 by simonmar]
simonmar [Mon, 21 Jul 2003 14:33:19 +0000 (14:33 +0000)]
[project @ 2003-07-21 14:33:19 by simonmar]
: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.

20 years ago[project @ 2003-07-21 14:28:02 by simonmar]
simonmar [Mon, 21 Jul 2003 14:28:02 +0000 (14:28 +0000)]
[project @ 2003-07-21 14:28:02 by simonmar]
Comment out the warning about filenames not matching module names.

20 years ago[project @ 2003-07-21 11:45:47 by simonmar]
simonmar [Mon, 21 Jul 2003 11:45:49 +0000 (11:45 +0000)]
[project @ 2003-07-21 11:45:47 by simonmar]
Add support for the new AWAKEN_BQ_CLOSURE macro to the NCG.  Fixes
broken HEAD builds.

20 years ago[project @ 2003-07-21 11:06:22 by simonpj]
simonpj [Mon, 21 Jul 2003 11:06:22 +0000 (11:06 +0000)]
[project @ 2003-07-21 11:06:22 by simonpj]
More on rules and specialisations

20 years ago[project @ 2003-07-21 11:01:06 by simonmar]
simonmar [Mon, 21 Jul 2003 11:01:07 +0000 (11:01 +0000)]
[project @ 2003-07-21 11:01:06 by simonmar]
When restoring the cost centre in a let-no-escape, don't free the
stack slot containing it.  We might need the saved cost centre again
for a recursive call to this let-no-escape.

Should fix profiling a bit more.

20 years ago[project @ 2003-07-20 21:28:04 by panne]
panne [Sun, 20 Jul 2003 21:28:04 +0000 (21:28 +0000)]
[project @ 2003-07-20 21:28:04 by panne]
Unbreak GHCi: Add stg_BLACKHOLE_BQ_info and awakenBlockedQueue to
RTS_SYMBOLS.

20 years ago[project @ 2003-07-20 16:33:24 by panne]
panne [Sun, 20 Jul 2003 16:33:26 +0000 (16:33 +0000)]
[project @ 2003-07-20 16:33:24 by panne]
To accomodate the Hugs package conversion magic, use separate
variables for OpenGL libraries and GLUT libraries.

20 years ago[project @ 2003-07-18 16:31:27 by simonmar]
simonmar [Fri, 18 Jul 2003 16:31:27 +0000 (16:31 +0000)]
[project @ 2003-07-18 16:31:27 by simonmar]
Restoring of cost centre in let-no-escape: we need to do this after
binding the args to stack locations, otherwise we end up grabbing the
wrong slot.

Should hopefully fix profiling crashes.  We still don't pay any
attention to the cost centre attached to the let-no-escape binding
itself, which looks wrong, but I don't intend to do anything about
that right now.

20 years ago[project @ 2003-07-18 14:39:05 by simonmar]
simonmar [Fri, 18 Jul 2003 14:39:06 +0000 (14:39 +0000)]
[project @ 2003-07-18 14:39:05 by simonmar]
When doing update-in-place, there is a (small) chance that the thunk
may have been blackholed and another thread might be waiting on it.
We can't therefore just splat it with the value; we have to check
whether it is a blocking queue and awaken any threads that might be
waiting on it if so.

Should fix the scavenge_mutable_list crash reported recently.  If it
does, it will be merged to STABLE.

20 years ago[project @ 2003-07-18 13:25:55 by simonmar]
simonmar [Fri, 18 Jul 2003 13:25:55 +0000 (13:25 +0000)]
[project @ 2003-07-18 13:25:55 by simonmar]
We don't need hacky filename comparisons in ppFilesFromSummaries now
that the real bug in SysTools has been fixed.

20 years ago[project @ 2003-07-18 13:18:06 by simonmar]
simonmar [Fri, 18 Jul 2003 13:18:07 +0000 (13:18 +0000)]
[project @ 2003-07-18 13:18:06 by simonmar]
Revision to the filename policy changes of yesterday.  This fixes the
broken stage2 and library builds.

The new story is this:

  A Haskell source filename should take the form

<path>/<basename>.<extension>

  where

<path>      is any directory
<basename>  is the name of the module, with dots replaced by slashes.
<extension> is ".hs" or ".lhs".

  given a source filename in this form, GHC will produce object and
  interface files named respectively:

        <hidir>/<basename>.<hisuf>
<odir>/<basename>.<osuf>

  where

<hidir>   is the value of the -hidir flag, if one was given, or
  the value of <path> from the source file otherwise.

<odir>    the same, for the -odir flag.

        <osuf>   the object suffix (settable with the -osuf flag)
<hisuf>   the hi suffix (settable with the -hisuf flag)

For example, if I have a module A.B.C, in source file foo/A/B/C.hs,
then GHC will create foo/A/B/C.hi and foo/A/B/C.o.

If GHC is given a source filename which is *not* of the form
<path>/<basename>.<extension>, then it uses a different strategy.
This happens if the filename does not follow the module name.  In this
case, GHC will set <path> to be the directory in which the source file
resides, and <basename> to the module name with dots replaced by
slashes, and then use the rules above.

For example, if we put module A.B.C in foo/bar/baz.hs, then GHC will
produce foo/bar/A/B/C.o and foo/bar/A/B/C.hi.

20 years ago[project @ 2003-07-18 12:55:06 by simonmar]
simonmar [Fri, 18 Jul 2003 12:55:06 +0000 (12:55 +0000)]
[project @ 2003-07-18 12:55:06 by simonmar]
oops, remove excess baggage in previous commit

20 years ago[project @ 2003-07-18 12:47:11 by simonmar]
simonmar [Fri, 18 Jul 2003 12:47:11 +0000 (12:47 +0000)]
[project @ 2003-07-18 12:47:11 by simonmar]
Fix a blatant bug in cleanTempFilesExcept, which was causing
legitimate source files to be deleted.  The previous fixes for this
bug missed the real cause of the problem.

I take full blame for this bug, which has been here since the dawn of
GHCi (at least I traced it back to 5.00).

20 years ago[project @ 2003-07-17 12:04:50 by simonmar]
simonmar [Thu, 17 Jul 2003 12:04:54 +0000 (12:04 +0000)]
[project @ 2003-07-17 12:04:50 by simonmar]
Filename-related cleanup & fixes
--------------------------------

This commit rationalises some of our filename policies.  The new story
is this:

  When compiling a Haskell module A.B.C:

    The object file is placed in <obj-path>/A/B/C.o
    The interface file is placed in <hi-path>/A/B/C.hi

    Where <objpath> is
- the argument of the -odir flag, if one was given
- the element of the search path in which the source file was found,
  when in --make mode.
- "." otherwise.

    Where <hipath> is
- the argument of the -hidir flag, if one was given
- the element of the search path in which the source file was found,
  when in --make mode.
- "." otherwise.

NOTE, in particular, that the name of the source file has no bearing
on the name of the object or interface file any more.  This is a
nchange from the previous semantics, where the name of the object file
would, under certain circumstances, follow the name of the source file.

eg. before, if you said

ghc -c dir/foo.hs

you would get dir/foo.o.  Now, you get something like Main.o,
depending on what module is in foo.hs.  This means that the driver
pipeline machinery now needs to pass around a Maybe ModLocation, which
is filled in by the Hsc phase and used later on to figure out the name
of the object file (this was fairly painful, but seems to be the only
way to get the right behaviour).

20 years ago[project @ 2003-07-17 08:59:03 by simonmar]
simonmar [Thu, 17 Jul 2003 08:59:03 +0000 (08:59 +0000)]
[project @ 2003-07-17 08:59:03 by simonmar]
Update comments to match reality.

20 years ago[project @ 2003-07-16 17:40:38 by sof]
sof [Wed, 16 Jul 2003 17:40:39 +0000 (17:40 +0000)]
[project @ 2003-07-16 17:40:38 by sof]
- change prototype of async proc calls to

      typedef int (*DoProcProc)(void *param);

  i.e., have the proc return a result. Turned out that almost all
  uses of the primop ended up encoding a result via their 'param'.

- when adding new I/O requests, shorten the time the IOManager
  lock is held. Helps to keep down the size of the thread pool.

20 years ago[project @ 2003-07-16 15:27:36 by sof]
sof [Wed, 16 Jul 2003 15:27:36 +0000 (15:27 +0000)]
[project @ 2003-07-16 15:27:36 by sof]
ppFilesFromSummaries.toPpFile: make it clear that file paths are being eq-tested here

20 years ago[project @ 2003-07-16 13:33:55 by simonmar]
simonmar [Wed, 16 Jul 2003 13:33:55 +0000 (13:33 +0000)]
[project @ 2003-07-16 13:33:55 by simonmar]
Put a newline after showing an I/O error.

20 years ago[project @ 2003-07-16 13:13:50 by simonmar]
simonmar [Wed, 16 Jul 2003 13:13:50 +0000 (13:13 +0000)]
[project @ 2003-07-16 13:13:50 by simonmar]
Respect -odir in one-shot compilations.

20 years ago[project @ 2003-07-16 08:49:01 by ross]
ross [Wed, 16 Jul 2003 08:49:05 +0000 (08:49 +0000)]
[project @ 2003-07-16 08:49:01 by ross]
Arrow notation: add a new (more primitive) form of command:

cmd ::= ... | cmd aexp

analogous to ordinary application, and also represented using HsApp.
To avoid an overlap, the syntax for combining forms is changed to

(|aexp cmd1 ... cmdn|)

20 years ago[project @ 2003-07-15 13:33:24 by ross]
ross [Tue, 15 Jul 2003 13:33:25 +0000 (13:33 +0000)]
[project @ 2003-07-15 13:33:24 by ross]
Add extra functions operating on outsized tuples (used by the translation
of arrow notation).

20 years ago[project @ 2003-07-12 00:11:20 by sof]
sof [Sat, 12 Jul 2003 00:11:20 +0000 (00:11 +0000)]
[project @ 2003-07-12 00:11:20 by sof]
interruptible(): add missing BlockedOnDoProc case

20 years ago[project @ 2003-07-12 00:10:31 by sof]
sof [Sat, 12 Jul 2003 00:10:31 +0000 (00:10 +0000)]
[project @ 2003-07-12 00:10:31 by sof]
awaitRequests(): BlockedOnDelay threads not expected on blocked_queue

20 years ago[project @ 2003-07-12 00:09:15 by sof]
sof [Sat, 12 Jul 2003 00:09:15 +0000 (00:09 +0000)]
[project @ 2003-07-12 00:09:15 by sof]
unblockThread: barf() string wibble

20 years ago[project @ 2003-07-12 00:08:28 by sof]
sof [Sat, 12 Jul 2003 00:08:28 +0000 (00:08 +0000)]
[project @ 2003-07-12 00:08:28 by sof]
[win32]delay#: set why_blocked to BlockedOnDoProc since we're appending the thread to blocked_queue

20 years ago[project @ 2003-07-11 08:53:25 by simonpj]
simonpj [Fri, 11 Jul 2003 08:53:26 +0000 (08:53 +0000)]
[project @ 2003-07-11 08:53:25 by simonpj]
Fix the big-char-literal parsing issue in External Core, correctly this time

20 years ago[project @ 2003-07-10 08:16:54 by simonpj]
simonpj [Thu, 10 Jul 2003 08:16:54 +0000 (08:16 +0000)]
[project @ 2003-07-10 08:16:54 by simonpj]
Give a more sensible type to big character literals in ExtCore (but it still looks odd to me)

20 years ago[project @ 2003-07-10 08:12:04 by simonpj]
simonpj [Thu, 10 Jul 2003 08:12:04 +0000 (08:12 +0000)]
[project @ 2003-07-10 08:12:04 by simonpj]
External Core was ignore sign on rational

20 years ago[project @ 2003-07-10 08:11:36 by simonpj]
simonpj [Thu, 10 Jul 2003 08:11:36 +0000 (08:11 +0000)]
[project @ 2003-07-10 08:11:36 by simonpj]
Markup fix

20 years ago[project @ 2003-07-10 08:02:29 by simonpj]
simonpj [Thu, 10 Jul 2003 08:02:29 +0000 (08:02 +0000)]
[project @ 2003-07-10 08:02:29 by simonpj]
Part of the fix to External-Core (:Main, not $Main), which got left out

20 years ago[project @ 2003-07-09 12:51:37 by simonpj]
simonpj [Wed, 9 Jul 2003 12:51:37 +0000 (12:51 +0000)]
[project @ 2003-07-09 12:51:37 by simonpj]
Remove redundant Var.hi-boot

20 years ago[project @ 2003-07-09 11:08:03 by simonpj]
simonpj [Wed, 9 Jul 2003 11:08:03 +0000 (11:08 +0000)]
[project @ 2003-07-09 11:08:03 by simonpj]
---------------------------------------
Wibble to GHCi constraint simplification
---------------------------------------

The new GHCi constraint-simplification story, with defaulting for
Show, Eq, Ord, should only apply to command-line expressions, not
to modules loaded by GHCi.

Hence new variant, TcSimplify.tcSimplifyInteractive

20 years ago[project @ 2003-07-09 11:06:31 by simonpj]
simonpj [Wed, 9 Jul 2003 11:06:32 +0000 (11:06 +0000)]
[project @ 2003-07-09 11:06:31 by simonpj]
--------------------------
Fix two External-Core bugs
--------------------------

1.  An inadvertent "let x = ...x..." bug in TcRnDriver

2.  Adjust the new -main-is story, so that the root module is called
":Main" instead of "$Main".
    This means that the z-encoded module name is "ZCMain" rather than "zdMain",
    which in keeps the External-Core lexer happy.  And is more consistent generally.

3.  Make the renamer happy to see definitions from modules other than the "home" one,
    when doing External Core.  In the main module, there'll be a definition for
    ZCMain.main.

20 years ago[project @ 2003-07-03 16:22:16 by simonpj]
simonpj [Thu, 3 Jul 2003 16:22:17 +0000 (16:22 +0000)]
[project @ 2003-07-03 16:22:16 by simonpj]
-----------------------
Type defaulting in GHCi
-----------------------

[Merge to stable branch, I think.]

[Part 2 to this commit: add Eq and Ord, to allow

[] == []

at the prompt.

      Extend type defaulting in GHCi so that

ghci>  []
[]

      works.  Suggested by Ralf Hinze.

20 years ago[project @ 2003-07-03 15:14:56 by sof]
sof [Thu, 3 Jul 2003 15:14:59 +0000 (15:14 +0000)]
[project @ 2003-07-03 15:14:56 by sof]
New primop (mingw only),

  asyncDoProc# :: Addr# -> Addr# -> State# RealWorld-> (# State# RealWorld, Int#, Int# #)

which lets a Haskell thread hand off a pointer to external code (1st arg) for
asynchronous execution by the RTS worker thread pool. Second arg is data passed
in to the asynchronous routine. The routine is _not_ permitted to re-enter
the RTS as part of its execution.

20 years ago[project @ 2003-07-03 14:33:18 by simonpj]
simonpj [Thu, 3 Jul 2003 14:33:22 +0000 (14:33 +0000)]
[project @ 2003-07-03 14:33:18 by simonpj]
-----------------------
Type defaulting in GHCi
-----------------------

[Merge to stable branch, I think.]

Extend type defaulting in GHCi so that

ghci>  []
[]

works.  Suggested by Ralf Hinze.

20 years ago[project @ 2003-07-03 14:32:30 by simonpj]
simonpj [Thu, 3 Jul 2003 14:32:30 +0000 (14:32 +0000)]
[project @ 2003-07-03 14:32:30 by simonpj]
Add pointer to TH home page

20 years ago[project @ 2003-07-03 10:55:41 by simonpj]
simonpj [Thu, 3 Jul 2003 10:55:41 +0000 (10:55 +0000)]
[project @ 2003-07-03 10:55:41 by simonpj]
Trim more imports

20 years ago[project @ 2003-07-03 10:35:37 by simonpj]
simonpj [Thu, 3 Jul 2003 10:35:37 +0000 (10:35 +0000)]
[project @ 2003-07-03 10:35:37 by simonpj]
Dont report assert as unused; merge to stable

20 years ago[project @ 2003-07-02 19:41:20 by ross]
ross [Wed, 2 Jul 2003 19:41:43 +0000 (19:41 +0000)]
[project @ 2003-07-02 19:41:20 by ross]
import fix

20 years ago[project @ 2003-07-02 14:59:00 by simonpj]
simonpj [Wed, 2 Jul 2003 14:59:12 +0000 (14:59 +0000)]
[project @ 2003-07-02 14:59:00 by simonpj]
Some random import trimming

20 years ago[project @ 2003-07-02 13:57:10 by stolz]
stolz [Wed, 2 Jul 2003 13:57:10 +0000 (13:57 +0000)]
[project @ 2003-07-02 13:57:10 by stolz]
autoconf probably knows best about vfork()

20 years ago[project @ 2003-07-02 13:18:24 by simonpj]
simonpj [Wed, 2 Jul 2003 13:19:29 +0000 (13:19 +0000)]
[project @ 2003-07-02 13:18:24 by simonpj]
Fixes two minor bugs that I came across in the old
CgCase code generation:

1. We were generating
tmp = Sp[1]
... more uses of Sp[1]....
instead of
tmp = Sp[1]
... more uses of tmp....
in the (case v of ...prim alts...) situation

2. The cost-centre restoration wasn't right for let-no-escapes

I kept this fix separate, becuase it does change the code generated
slightly.

20 years ago[project @ 2003-07-02 13:12:33 by simonpj]
simonpj [Wed, 2 Jul 2003 13:12:39 +0000 (13:12 +0000)]
[project @ 2003-07-02 13:12:33 by simonpj]
------------------------
       Tidy up the code generator
------------------------

The code generation for 'case' expressions had grown
huge and gnarly.  This commit removes about 120 lines of
code, and makes it a lot easier to read too. I think the code
generated is identical.

Part of this was to simplify the StgCase data type, so
that it is more like the Core case: there is a simple list
of alternatives, and the DEFAULT (if present) must be the
first.  This tidies and simplifies other Stg passes.

20 years ago[project @ 2003-07-01 12:25:49 by panne]
panne [Tue, 1 Jul 2003 12:25:49 +0000 (12:25 +0000)]
[project @ 2003-07-01 12:25:49 by panne]
Mention unix package only for non-WinDoze builds.

20 years ago[project @ 2003-07-01 11:44:46 by panne]
panne [Tue, 1 Jul 2003 11:44:46 +0000 (11:44 +0000)]
[project @ 2003-07-01 11:44:46 by panne]
The starting page of the GHC Documentation contains no autoconf tricks
anymore, so keep things simple...

20 years ago[project @ 2003-07-01 11:21:57 by panne]
panne [Tue, 1 Jul 2003 11:21:59 +0000 (11:21 +0000)]
[project @ 2003-07-01 11:21:57 by panne]
Tweaked help strings for --enable-objectio and --enable-hopengl options.

20 years ago[project @ 2003-07-01 10:31:43 by simonpj]
simonpj [Tue, 1 Jul 2003 10:31:43 +0000 (10:31 +0000)]
[project @ 2003-07-01 10:31:43 by simonpj]
Wibble to printing HsSyn variables

20 years ago[project @ 2003-07-01 10:21:21 by simonmar]
simonmar [Tue, 1 Jul 2003 10:21:21 +0000 (10:21 +0000)]
[project @ 2003-07-01 10:21:21 by simonmar]
Add ancient HEP document, which might be revived.

20 years ago[project @ 2003-06-30 15:00:33 by simonmar]
simonmar [Mon, 30 Jun 2003 15:00:33 +0000 (15:00 +0000)]
[project @ 2003-06-30 15:00:33 by simonmar]
Back out previous revision, we'll tackle this a different way.

20 years ago[project @ 2003-06-30 14:40:25 by simonpj]
simonpj [Mon, 30 Jun 2003 14:40:25 +0000 (14:40 +0000)]
[project @ 2003-06-30 14:40:25 by simonpj]
Another buglet in TcRnDriver for ghci

20 years ago[project @ 2003-06-30 14:27:51 by simonpj]
simonpj [Mon, 30 Jun 2003 14:27:52 +0000 (14:27 +0000)]
[project @ 2003-06-30 14:27:51 by simonpj]
-------------------
Fix a subtle GC bug
-------------------

In GHC 6.0, the top-level definition

f = g

gets compiled as a *non-updatable* THUNK_STATIC closure.  Being non-updatable,
it gets only 1 payload field.  Alas, the static-link field for a THUNK_STATIC
goes in the 3rd payload field.  Disaster.

Solution: make such things updatable. This is probably good because it turns
f into an IND_STATIC, which gets shorted out.  (Even better would be to allocate
an IND_STATIC in the first place.)

20 years ago[project @ 2003-06-30 14:17:02 by simonmar]
simonmar [Mon, 30 Jun 2003 14:17:02 +0000 (14:17 +0000)]
[project @ 2003-06-30 14:17:02 by simonmar]
comments only.

20 years ago[project @ 2003-06-30 09:31:46 by ross]
ross [Mon, 30 Jun 2003 09:31:46 +0000 (09:31 +0000)]
[project @ 2003-06-30 09:31:46 by ross]
documentation for -farrows

20 years ago[project @ 2003-06-27 21:17:24 by simonpj]
simonpj [Fri, 27 Jun 2003 21:17:25 +0000 (21:17 +0000)]
[project @ 2003-06-27 21:17:24 by simonpj]
Heal the head

20 years ago[project @ 2003-06-27 18:28:31 by sof]
sof [Fri, 27 Jun 2003 18:28:33 +0000 (18:28 +0000)]
[project @ 2003-06-27 18:28:31 by sof]
Do as for one-shot linking and implicitly supply packages 'base' and
'haskell98' when piecing together a DLL.

Merge to STABLE.

20 years ago[project @ 2003-06-27 18:08:53 by wolfgang]
wolfgang [Fri, 27 Jun 2003 18:08:53 +0000 (18:08 +0000)]
[project @ 2003-06-27 18:08:53 by wolfgang]
PowerPC: Make it work with Apple's version of GCC 3.3

20 years ago[project @ 2003-06-27 16:53:07 by stolz]
stolz [Fri, 27 Jun 2003 16:53:07 +0000 (16:53 +0000)]
[project @ 2003-06-27 16:53:07 by stolz]
Push down CPPFLAGS, CFLAGS and LDFLAGS.

Now ./configure should pick up those flags and hopefully make life a bit
easier for packagers. Notice that some flags which work fine for 'ld'
won't work with ghc, e.g. the combination "-Wl,-E" which 'gtk-config --libs'
suggests, so you'll usually want to set only -I or -L.

> ghc -Wl,-E
ghc-6.0: unrecognised flags: -Wl,-E

http://www.haskell.org/pipermail/glasgow-haskell-users/2003-June/005243.html

20 years ago[project @ 2003-06-27 16:21:10 by stolz]
stolz [Fri, 27 Jun 2003 16:21:11 +0000 (16:21 +0000)]
[project @ 2003-06-27 16:21:10 by stolz]
From genargs.pl:
# This program generates a partial Haskell list of Strings from
# words passed via stdin suitable for use in package.conf, e.g.:
#
#   foo bar   --> "foo", "bar"
#   "foo bar" --> "foo bar"
#   foo\"bar  --> "foo\"bar"
#
# Invoking genargs.pl with -comma will print an initial comma if
# there's anything to print at all.
#
# Sample application in a Makefile:
#  HSIFIED_EXTRA_LD_OPTS= `echo "$(EXTRA_LD_OPTS)" | $(PERL) genargs.pl`
#  PACKAGE_CPP_OPTS += -DHSIFIED_EXTRA_LD_OPTS="$(HSIFIED_EXTRA_LD_OPTS)"

20 years ago[project @ 2003-06-26 21:55:46 by sof]
sof [Thu, 26 Jun 2003 21:55:47 +0000 (21:55 +0000)]
[project @ 2003-06-26 21:55:46 by sof]
SysTools.removeTmpFiles:
  - never delete source files with a DriverPhases.haskellish_user_src_file
    file extension & loudly complain should the compiler attempt to do so.

    This is a protective measure against bugs elsewhere in the driver pipeline
    (cf., 'ghc-6.0 --make' deleting input files if specified using backward
     instead of forward slashes under win32.)

20 years ago[project @ 2003-06-26 20:58:33 by panne]
panne [Thu, 26 Jun 2003 20:58:33 +0000 (20:58 +0000)]
[project @ 2003-06-26 20:58:33 by panne]
Unbreak GHCi: Add raiseIOzh_fast to RTS_SYMBOLS

20 years ago[project @ 2003-06-26 20:49:32 by panne]
panne [Thu, 26 Jun 2003 20:49:32 +0000 (20:49 +0000)]
[project @ 2003-06-26 20:49:32 by panne]
Warning police: Added #include for strerror

20 years ago[project @ 2003-06-26 20:48:59 by panne]
panne [Thu, 26 Jun 2003 20:48:59 +0000 (20:48 +0000)]
[project @ 2003-06-26 20:48:59 by panne]
Warning police: Fixed Sym macro to generate a real function prototype

20 years ago[project @ 2003-06-26 20:47:47 by panne]
panne [Thu, 26 Jun 2003 20:47:47 +0000 (20:47 +0000)]
[project @ 2003-06-26 20:47:47 by panne]
Warning police: Added cast

20 years ago[project @ 2003-06-26 20:47:08 by panne]
panne [Thu, 26 Jun 2003 20:47:08 +0000 (20:47 +0000)]
[project @ 2003-06-26 20:47:08 by panne]
Warning police: Added newline at end of file

20 years ago[project @ 2003-06-26 12:22:59 by stolz]
stolz [Thu, 26 Jun 2003 12:22:59 +0000 (12:22 +0000)]
[project @ 2003-06-26 12:22:59 by stolz]
Warning Police: include unistd.h if available

20 years ago[project @ 2003-06-25 16:24:56 by simonpj]
simonpj [Wed, 25 Jun 2003 16:24:58 +0000 (16:24 +0000)]
[project @ 2003-06-25 16:24:56 by simonpj]
Wibbles; esp fixing the stage2 build

20 years ago[project @ 2003-06-25 08:20:20 by simonpj]
simonpj [Wed, 25 Jun 2003 08:20:22 +0000 (08:20 +0000)]
[project @ 2003-06-25 08:20:20 by simonpj]
* Remove -ffoldr-build-on
  Add -rrules-off
  Document the change

* Document -fwarn-simple-patterns more

20 years ago[project @ 2003-06-25 08:17:24 by simonpj]
simonpj [Wed, 25 Jun 2003 08:17:24 +0000 (08:17 +0000)]
[project @ 2003-06-25 08:17:24 by simonpj]
Remove dead code

20 years ago[project @ 2003-06-24 13:45:49 by stolz]
stolz [Tue, 24 Jun 2003 13:45:49 +0000 (13:45 +0000)]
[project @ 2003-06-24 13:45:49 by stolz]
Remove large chunk of duplicated documentation.

20 years ago[project @ 2003-06-24 12:56:43 by stolz]
stolz [Tue, 24 Jun 2003 12:56:44 +0000 (12:56 +0000)]
[project @ 2003-06-24 12:56:43 by stolz]
FreeBSD Threaded-RTS wibbles (-pthread in {C,LD}FLAGS)

20 years ago[project @ 2003-06-24 10:03:39 by simonmar]
simonmar [Tue, 24 Jun 2003 10:03:39 +0000 (10:03 +0000)]
[project @ 2003-06-24 10:03:39 by simonmar]
Back out previous revision, the -traditional flag is now added in the
suffix rule for .pp files (see $FPTOOLS_TOP/mk/suffix.mk).

20 years ago[project @ 2003-06-24 10:01:27 by simonmar]
simonmar [Tue, 24 Jun 2003 10:01:27 +0000 (10:01 +0000)]
[project @ 2003-06-24 10:01:27 by simonmar]
"rec" should be a keyword only when -farrows is on, not when
-fglasgow-exts is on.

20 years ago[project @ 2003-06-24 09:44:44 by ross]
ross [Tue, 24 Jun 2003 09:44:44 +0000 (09:44 +0000)]
[project @ 2003-06-24 09:44:44 by ross]
fix bug with ExprStmt, plus some cleaning up.

20 years ago[project @ 2003-06-24 09:43:23 by simonmar]
simonmar [Tue, 24 Jun 2003 09:43:23 +0000 (09:43 +0000)]
[project @ 2003-06-24 09:43:23 by simonmar]
Fix up compilation with GHC 5.02

20 years ago[project @ 2003-06-24 09:32:34 by stolz]
stolz [Tue, 24 Jun 2003 09:32:34 +0000 (09:32 +0000)]
[project @ 2003-06-24 09:32:34 by stolz]
Fix another occurence of openFileEx in stage2

20 years ago[project @ 2003-06-24 08:49:55 by stolz]
stolz [Tue, 24 Jun 2003 08:49:55 +0000 (08:49 +0000)]
[project @ 2003-06-24 08:49:55 by stolz]
- AP_UPD got renamed to AP in rev. 1.18 of ClosureTypes.h
- #if 0-out section which is a sure segfault in the colouring loop

20 years ago[project @ 2003-06-24 08:47:05 by stolz]
stolz [Tue, 24 Jun 2003 08:47:05 +0000 (08:47 +0000)]
[project @ 2003-06-24 08:47:05 by stolz]
Can't use tab stops in GTK

20 years ago[project @ 2003-06-24 08:31:35 by stolz]
stolz [Tue, 24 Jun 2003 08:31:35 +0000 (08:31 +0000)]
[project @ 2003-06-24 08:31:35 by stolz]
Make 'depend' treated GTK includes as missing when building with FrontPanel.

20 years ago[project @ 2003-06-24 08:29:13 by stolz]
stolz [Tue, 24 Jun 2003 08:29:13 +0000 (08:29 +0000)]
[project @ 2003-06-24 08:29:13 by stolz]
Eliminate warnings for ELF_*

20 years ago[project @ 2003-06-24 08:03:15 by simonpj]
simonpj [Tue, 24 Jun 2003 08:03:15 +0000 (08:03 +0000)]
[project @ 2003-06-24 08:03:15 by simonpj]
comments only

20 years ago[project @ 2003-06-24 07:58:18 by simonpj]
simonpj [Tue, 24 Jun 2003 07:58:27 +0000 (07:58 +0000)]
[project @ 2003-06-24 07:58:18 by simonpj]
----------------------------------------------
Add support for Ross Paterson's arrow notation
----------------------------------------------

Ross Paterson's ICFP'01 paper described syntax to support John Hughes's
"arrows", rather as do-notation supports monads.  Except that do-notation is
relatively modest -- you can write monads by hand without much trouble --
whereas arrow-notation is more-or-less essential for writing arrow programs.
It desugars to a massive pile of tuple construction and selection!

For some time, Ross has had a pre-processor for arrow notation, but the
resulting type error messages (reported in terms of the desugared code)
are impenetrable.  This commit integrates the syntax into GHC.  The
type error messages almost certainly still require tuning, but they should
be better than with the pre-processor.

Main syntactic changes (enabled with -farrows)

   exp ::= ... | proc pat -> cmd

   cmd ::= exp1 -<  exp2   |  exp1 >-  exp2
|  exp1 -<< exp2   |  exp1 >>- exp2
| \ pat1 .. patn -> cmd
| let decls in cmd
| if exp then cmd1 else cmd2
| do { cstmt1 .. cstmtn ; cmd }
| (| exp |) cmd1 .. cmdn
| cmd1 qop cmd2
| case exp of { calts }

   cstmt :: = let decls
 |   pat <- cmd
 |   rec { cstmt1 .. cstmtn }
 |   cmd

New keywords and symbols:
proc rec
-<   >-   -<<   >>-
(|  |)

The do-notation in cmds was not described in Ross's ICFP'01 paper; instead
it's in his chapter in The Fun of Programming (Plagrave 2003).

The four arrow-tail forms (-<) etc cover
  (a) which order the pices come in (-<  vs  >-), and
  (b) whether the locally bound variables can be used in the
arrow part (-<  vs  -<<) .
In previous presentations, the higher-order-ness (b) was inferred,
but it makes a big difference to the typing required so it seems more
consistent to be explicit.

The 'rec' form is also available in do-notation:
  * you can use 'rec' in an ordinary do, with the obvious meaning
  * using 'mdo' just says "infer the minimal recs"

Still to do
~~~~~~~~~~~
Top priority is the user manual.

The implementation still lacks an implementation of
the case form of cmd.

Implementation notes
~~~~~~~~~~~~~~~~~~~~
Cmds are parsed, and indeed renamed, as expressions.  The type checker
distinguishes the two.

20 years ago[project @ 2003-06-23 19:40:21 by sof]
sof [Mon, 23 Jun 2003 19:40:21 +0000 (19:40 +0000)]
[project @ 2003-06-23 19:40:21 by sof]
setTmpDir: canonicalise temp file paths under mingw:
  - convert backslashes into forward ones
  - drop trailing slash
  - translate /cygdrive/drive/path to drive:/path, coping with
    cygwin-centric settings for TMP or TEMP.

20 years ago[project @ 2003-06-23 11:46:40 by simonpj]
simonpj [Mon, 23 Jun 2003 11:46:40 +0000 (11:46 +0000)]
[project @ 2003-06-23 11:46:40 by simonpj]
------------------------------------------------------
Make the strictness analyser more conservative for I/O
------------------------------------------------------

Consider
do { let len = <expensive> ;
   ; when (...) (exitWith ExitSuccess)
   ; print len }

Is it safe to evaluate <expensive> before doing the 'when'?  Remember,
<expensive> might raise an exception etc as well.

Normal strictness analysis answer: yes, because either the when... diverges
or raises an exception, or the print will happen.

Correct I/O answer: no, because it's perfectly OK to terminate the program
successfully.  And don't say the 'len' could be pushed down, because (a) sometimes
it can't and (b) sometimes the compiler might float it out.

This commit adds a hack to the demand analyser, so that it treats a case that
looks like I/O (unboxed pair, real-world as first bindre) specially, by lub'ing
the returned strictness type with TopType.  A bit like adding a dummy never-taken
branch.  This seems a bit hack-oid, but it's quick and it works.  Not clear
how to do it 'right', either.

Test is in stranal/should_run/strun003.

20 years ago[project @ 2003-06-23 11:46:06 by simonpj]
simonpj [Mon, 23 Jun 2003 11:46:06 +0000 (11:46 +0000)]
[project @ 2003-06-23 11:46:06 by simonpj]
Fix previous -main-is commit

20 years ago[project @ 2003-06-23 10:35:15 by simonpj]
simonpj [Mon, 23 Jun 2003 10:35:23 +0000 (10:35 +0000)]
[project @ 2003-06-23 10:35:15 by simonpj]
-------------------
Dealing with 'main'
-------------------

1.  In GHC 6.0, a module with no "module Main ... where" header
    elicited an error "main is not in scope" if 'main' is not defined.  We
    don't want this behaviour in GHCi.  This happened because the parser
    expanded the (absent) header to "module Main( main ) where", and the
    'main' in the export list isn't.

Solution: elaborate HsModule to record whether the 'module ..." header was
given explicitly by the user or not.

2.  Add a -main-is flag, and document it, so that you can have a 'main' function
that is not Main.main.  Summary of changes

* The -main-is flag nominates what the main function is to be (see the documentation).
No -main-is flag  says that the main function is Main.main
-main-is Foo.baz says that the main function is Foo.baz
-main-is Foo says that the main function is Foo.main
-main-is baz says that the main function is Main.baz

  Let's say  you say -main-is Foo.baz

* TcRnDriver injects the extra definition
$Mian.main :: IO t
$Main.main = baz
  in the module Foo.   Note the naming, which is a bit different than before;
  previously the extra defn was for Main.$main.  The RTS invokes zdMain_main_closure.

* CodeGen injects an extra initialisation block into module Foo, thus
stginit_zdMain {
stginit_Foo
}
  That ensures that the RTS can initialise stginit_zdMain.

20 years ago[project @ 2003-06-23 10:13:03 by simonmar]
simonmar [Mon, 23 Jun 2003 10:13:03 +0000 (10:13 +0000)]
[project @ 2003-06-23 10:13:03 by simonmar]
openFileEx can't be gotten from GHC.Handle any more.

20 years ago[project @ 2003-06-20 11:14:18 by simonpj]
simonpj [Fri, 20 Jun 2003 11:14:22 +0000 (11:14 +0000)]
[project @ 2003-06-20 11:14:18 by simonpj]
------------------------------
Fix a small quantification bug
------------------------------

We were quantifying over too few type variables, because fdPredsOfInsts was
being too eager to discard predicates. This only affects rather obscure
programs.  Here's the one Iavor found:

class C a b where f :: a -> b
g x = fst (f x)

We want to get the type
    g :: forall a b c.  C a (b,c) => a -> b
but GHC 6.0 bogusly gets
    g :: forall a b.  C a (b,()) => a -> b

A test is in should_compile/tc168

20 years ago[project @ 2003-06-19 18:53:09 by sof]
sof [Thu, 19 Jun 2003 18:53:09 +0000 (18:53 +0000)]
[project @ 2003-06-19 18:53:09 by sof]
add -traditional to SRC_CPP_OPTS to silence (harmless)
'unterminated char constant' warnings when processing .pp files.

20 years ago[project @ 2003-06-19 12:47:08 by simonmar]
simonmar [Thu, 19 Jun 2003 12:47:08 +0000 (12:47 +0000)]
[project @ 2003-06-19 12:47:08 by simonmar]
small optimisation: when evacuating a TSO, only copy the part of the
stack that is above the stack pointer and hence in use (doesn't apply
to most stacks, which are large objects and don't get copied anyhow).

20 years ago[project @ 2003-06-19 11:27:42 by simonmar]
simonmar [Thu, 19 Jun 2003 11:27:42 +0000 (11:27 +0000)]
[project @ 2003-06-19 11:27:42 by simonmar]
Remove slightly bogus -traditional flag from SRC_CPP_OPTS here.