Re: Duplicated typedef trips my gcc over

2015-10-26 Thread Gabor Greif
I have just committed a tentative fix I am using for a while, and keep
watching the buildbots.

Cheers,

Gabor

On 10/26/15, Christiaan Baaij  wrote:
> I cannot build HEAD for the same reason. Same GCC version.
>
> On 21 October 2015 at 13:08, Gabor Greif  wrote:
>
>> Hi all,
>>
>> look:
>>
>> $ git grep "typedef struct LibDwSession_ "
>> rts/Libdw.c:typedef struct LibDwSession_ LibDwSession;
>> rts/Libdw.h:typedef struct LibDwSession_ LibDwSession;
>>
>> $ which gcc
>> /usr/bin/gcc
>>
>> $ gcc --version
>> gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
>> Copyright (C) 2010 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is
>> NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>>
>> Any reason why we need the typedef in rts/Libdw.c ?? My gcc complains
>> about it...
>>
>> Cheers,
>>
>> Gabor
>> ___
>> ghc-devs mailing list
>> ghc-devs@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Duplicated typedef trips my gcc over

2015-10-26 Thread Ben Gamari
Gabor Greif  writes:

> Hi all,
>
> look:
>
> $ git grep "typedef struct LibDwSession_ "
> rts/Libdw.c:typedef struct LibDwSession_ LibDwSession;
> rts/Libdw.h:typedef struct LibDwSession_ LibDwSession;
>
> $ which gcc
> /usr/bin/gcc
>
> $ gcc --version
> gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
> Copyright (C) 2010 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> Any reason why we need the typedef in rts/Libdw.c ?? My gcc complains
> about it...
>
Nope; your fix ought to be fine.

Thanks!

- Ben



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Sphinx on Windows

2015-10-26 Thread Simon Peyton Jones
Thanks.

But it's a bit inefficient to debug by email.  For now I've simply switched off 
the sphinx stuff in my build.mk.  Might you work it through when you have 
access to a machine, and document the result?

If the desired sequence is to
  * get pip
  * use pip to get sphinx

then could the docs on 
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
be update to say precisely that?  Someone went to some trouble to make that 
page short and easy, and perhaps there is a more direct route. I'm not sure.  

Many thanks

Simon

|  -Original Message-
|  From: David Kraeutmann [mailto:k...@kane.cx]
|  Sent: 26 October 2015 10:01
|  To: Simon Peyton Jones
|  Cc: ghc-devs@haskell.org
|  Subject: Re: Sphinx on Windows
|  
|  Grab
|  https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fbootstrap.p
|  ypa.io%2fget-
|  pip.py=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c2143737483a740eb651
|  308d2ddec5e3d%7c72f988bf86f141af91ab2d7cd011db47%7c1=YnlD5KrF3LBjq2ys8
|  M4ZSsv26Qgrwo7WdYYaUh2sNiU%3d and do `python
|  https://na01.safelinks.protection.outlook.com/?url=get-
|  pip.py=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c2143737483a740eb651
|  308d2ddec5e3d%7c72f988bf86f141af91ab2d7cd011db47%7c1=2DVk4wuIWO9bYpS7Y
|  XBuInrDI9jER9ETucrMnvvPjEA%3d'
|  from a command prompt (might need to be elevated, not sure). After that
|  'pip' should be available and you can do 'pip install sphinx'.
|  
|  On Mon, Oct 26, 2015 at 10:41 AM, Simon Peyton Jones 
|  wrote:
|  > I have not tried that.  But 'pip' gives "command not found".
|  >
|  > Maybe I need something in my path?  I appear to have python 2.7.5
|  installed; it does not appear to have pip.exe.
|  >
|  > Simon
|  >
|  > |  -Original Message-
|  > |  From: David Kraeutmann [mailto:k...@kane.cx]
|  > |  Sent: 26 October 2015 08:32
|  > |  To: Simon Peyton Jones
|  > |  Cc: ghc-devs@haskell.org
|  > |  Subject: Re: Sphinx on Windows
|  > |
|  > |  'pip' is just a Python package manager. Following the steps at
|  > |
|  > | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsphi
|  > | nx-
|  > |  doc.org%2flatest%2finstall.html%23windows-install-python-and-
|  > |
|  > | sphinx=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064e
|  > | e4e54daa
|  > | d08d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=TtHa5dAl%
|  > | 2fEASoNW
|  > |  kXJDQ0Om6ilkxRguR%2bpBrZP19ujc%3d
|  > |  should give you a working sphinx install. I can test those on my
|  > | Windows  machine once I'm home, but that won't be for a few hours.
|  > |
|  > |  On Mon, Oct 26, 2015 at 8:59 AM, Simon Peyton Jones
|  > | 
|  > |  wrote:
|  > |  > The GHC wiki says you need Sphinx to build docs,  >  >  >
|  > | https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
|  > |  >
|  > |  > and refers to the Preparation doc for how to install Sphinx  >  >
|  > | https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
|  > |  >
|  > |  > But the Windows sub-page of Preparation does not say how to
|  > | install  Sphinx.
|  > |  >
|  > |  > Question: how does one install Sphinx on Windows?  The sphinx-doc
|  > | home  > page mutters about ‘pip’, but I’ve never used that.  Does
|  > | anyone have  > instructions?
|  > |  >
|  > |  > Thanks
|  > |  >
|  > |  > Simon
|  > |  >
|  > |  >
|  > |  > ___
|  > |  > ghc-devs mailing list
|  > |  > ghc-devs@haskell.org
|  > |  >
|  > | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail
|  > | .h  > askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  > |
|  > | devs=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064ee4
|  > | e54daad0
|  > | 8d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=zUsjfvEKGbI
|  > | jR%2b9QP
|  > |  InIXPKB7P%2bt2zXcPxLPvHlzWNs%3d
|  > |  >
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Sphinx on Windows

2015-10-26 Thread Ben Gamari
Simon Peyton Jones  writes:

> I have not tried that.  But 'pip' gives "command not found".
>
> Maybe I need something in my path?  I appear to have python 2.7.5 installed; 
> it does not appear to have pip.exe.
>
Pip ships with Python 2.7.9 and later. Alternatively, you this script
[1] will install pip for you. Just download it and run it with,

$ python get-pip.py

See the Sphinx installation page [2] for details.

Cheers,

- Ben

[1] https://bootstrap.pypa.io/get-pip.py
[2] http://sphinx-doc.org/install.html#windows-install-python-and-sphinx


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Duplicated typedef trips my gcc over

2015-10-26 Thread Christiaan Baaij
I cannot build HEAD for the same reason. Same GCC version.

On 21 October 2015 at 13:08, Gabor Greif  wrote:

> Hi all,
>
> look:
>
> $ git grep "typedef struct LibDwSession_ "
> rts/Libdw.c:typedef struct LibDwSession_ LibDwSession;
> rts/Libdw.h:typedef struct LibDwSession_ LibDwSession;
>
> $ which gcc
> /usr/bin/gcc
>
> $ gcc --version
> gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
> Copyright (C) 2010 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> Any reason why we need the typedef in rts/Libdw.c ?? My gcc complains
> about it...
>
> Cheers,
>
> Gabor
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Sphinx on Windows

2015-10-26 Thread David Kraeutmann
Grab https://bootstrap.pypa.io/get-pip.py and do `python get-pip.py'
from a command prompt (might need to be elevated, not sure). After
that 'pip' should be available and you can do 'pip install sphinx'.

On Mon, Oct 26, 2015 at 10:41 AM, Simon Peyton Jones
 wrote:
> I have not tried that.  But 'pip' gives "command not found".
>
> Maybe I need something in my path?  I appear to have python 2.7.5 installed; 
> it does not appear to have pip.exe.
>
> Simon
>
> |  -Original Message-
> |  From: David Kraeutmann [mailto:k...@kane.cx]
> |  Sent: 26 October 2015 08:32
> |  To: Simon Peyton Jones
> |  Cc: ghc-devs@haskell.org
> |  Subject: Re: Sphinx on Windows
> |
> |  'pip' is just a Python package manager. Following the steps at
> |  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsphinx-
> |  doc.org%2flatest%2finstall.html%23windows-install-python-and-
> |  
> sphinx=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064ee4e54daa
> |  
> d08d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=TtHa5dAl%2fEASoNW
> |  kXJDQ0Om6ilkxRguR%2bpBrZP19ujc%3d
> |  should give you a working sphinx install. I can test those on my Windows
> |  machine once I'm home, but that won't be for a few hours.
> |
> |  On Mon, Oct 26, 2015 at 8:59 AM, Simon Peyton Jones 
> |  wrote:
> |  > The GHC wiki says you need Sphinx to build docs,
> |  >
> |  >
> |  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
> |  >
> |  > and refers to the Preparation doc for how to install Sphinx
> |  >
> |  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
> |  >
> |  > But the Windows sub-page of Preparation does not say how to install
> |  Sphinx.
> |  >
> |  > Question: how does one install Sphinx on Windows?  The sphinx-doc home
> |  > page mutters about ‘pip’, but I’ve never used that.  Does anyone have
> |  > instructions?
> |  >
> |  > Thanks
> |  >
> |  > Simon
> |  >
> |  >
> |  > ___
> |  > ghc-devs mailing list
> |  > ghc-devs@haskell.org
> |  > https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h
> |  > askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
> |  
> devs=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064ee4e54daad0
> |  
> 8d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=zUsjfvEKGbIjR%2b9QP
> |  InIXPKB7P%2bt2zXcPxLPvHlzWNs%3d
> |  >
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Sphinx on Windows

2015-10-26 Thread Simon Peyton Jones
I have not tried that.  But 'pip' gives "command not found".

Maybe I need something in my path?  I appear to have python 2.7.5 installed; it 
does not appear to have pip.exe.

Simon

|  -Original Message-
|  From: David Kraeutmann [mailto:k...@kane.cx]
|  Sent: 26 October 2015 08:32
|  To: Simon Peyton Jones
|  Cc: ghc-devs@haskell.org
|  Subject: Re: Sphinx on Windows
|  
|  'pip' is just a Python package manager. Following the steps at
|  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsphinx-
|  doc.org%2flatest%2finstall.html%23windows-install-python-and-
|  sphinx=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064ee4e54daa
|  d08d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=TtHa5dAl%2fEASoNW
|  kXJDQ0Om6ilkxRguR%2bpBrZP19ujc%3d
|  should give you a working sphinx install. I can test those on my Windows
|  machine once I'm home, but that won't be for a few hours.
|  
|  On Mon, Oct 26, 2015 at 8:59 AM, Simon Peyton Jones 
|  wrote:
|  > The GHC wiki says you need Sphinx to build docs,
|  >
|  >
|  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
|  >
|  > and refers to the Preparation doc for how to install Sphinx
|  >
|  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
|  >
|  > But the Windows sub-page of Preparation does not say how to install
|  Sphinx.
|  >
|  > Question: how does one install Sphinx on Windows?  The sphinx-doc home
|  > page mutters about ‘pip’, but I’ve never used that.  Does anyone have
|  > instructions?
|  >
|  > Thanks
|  >
|  > Simon
|  >
|  >
|  > ___
|  > ghc-devs mailing list
|  > ghc-devs@haskell.org
|  > https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h
|  > askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  devs=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c865e98e064ee4e54daad0
|  8d2dddff6dd%7c72f988bf86f141af91ab2d7cd011db47%7c1=zUsjfvEKGbIjR%2b9QP
|  InIXPKB7P%2bt2zXcPxLPvHlzWNs%3d
|  >
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Sphinx on Windows

2015-10-26 Thread David Kraeutmann
'pip' is just a Python package manager. Following the steps at
http://sphinx-doc.org/latest/install.html#windows-install-python-and-sphinx
should give you a working sphinx install. I can test those on my
Windows machine once I'm home, but that won't be for a few hours.

On Mon, Oct 26, 2015 at 8:59 AM, Simon Peyton Jones
 wrote:
> The GHC wiki says you need Sphinx to build docs,
>
> https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
>
> and refers to the Preparation doc for how to install Sphinx
>
> https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
>
> But the Windows sub-page of Preparation does not say how to install Sphinx.
>
> Question: how does one install Sphinx on Windows?  The sphinx-doc home page
> mutters about ‘pip’, but I’ve never used that.  Does anyone have
> instructions?
>
> Thanks
>
> Simon
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Sphinx on Windows

2015-10-26 Thread Simon Peyton Jones
The GHC wiki says you need Sphinx to build docs,
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
and refers to the Preparation doc for how to install Sphinx
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
But the Windows sub-page of Preparation does not say how to install Sphinx.
Question: how does one install Sphinx on Windows?  The sphinx-doc home page 
mutters about 'pip', but I've never used that.  Does anyone have instructions?
Thanks
Simon
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Segfault in a CoreLinted program (and a GHC-generated Core question)

2015-10-26 Thread Ömer Sinan Ağacan
OK, thanks to people at IRC channel(especially @rwbarton) I realized
that my lint calls were not actually running, simply because I wasn't
using -dcore-lint.. I didn't know such a flag exists, and even with
the absence of the flag I'd expect a core lint would work, because I'm
explicitly calling the lint function without checking any flags!

CoreLint is now giving me really awesome diagnostics! Sorry for the noise..

(I'll try to document linter functions or CoreLint module to let the
user know he/she needs this flag!)

2015-10-26 13:43 GMT-04:00 Simon Peyton Jones :
> |  So my questions are: Am I right in assuming that CoreLint accepted programs
> |  should not segfault?
>
> Yes.  Modulo unsafeCoerce, and FFI calls.
>
> | What about internal invariants? Should CoreLint check
> |  for those? Is there any pass that checks for invariants and prints helpful
> |  messages in case of a invariant invalidation?
>
> Yes; they are documented in CoreSyn, which the data type, and Lint checks 
> them.
>
> |  As an attempt at debugging the code generated by my plugin, I wrote the
> |  function that is supposed to be generated by my Core pass in Haskell and
> |  compiled with GHC. Generated Core is mostly the same, except at one point 
> it
> |  has an extra lambda directly applied to a void#, something like ((\_ -> 
> ...)
> |  void#). Where can I learn more about why GHC is doing that?
>
> Show me the code!
>
> Instead of generating
>
> x :: Int# = 
>
> GHC sometimes generates
>
> x :: Void# -> Int# = \_ - 
>
> and then calls (x void#), to make any div-zero failures happen at the right 
> place.
>
> I'm not sure if that is what you are seeing, but we can work it out when you 
> give more detail.
>
> Simon
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: can't get haddock patch

2015-10-26 Thread Simon Peyton Jones
| Regardless, I can take care of it from here.

great. But I could not validate because of this, so may not be finished.

Would it make sense to push changes to the haddock repo (as I have done for my 
other inflight changes)?

Anyway, if you'd like me to take this any further, let me know explicitly, with 
instructions for how to build.

Thakns

Simon


| -Original Message-
| From: Ben Gamari [mailto:b...@well-typed.com]
| Sent: 26 October 2015 18:56
| To: Simon Peyton Jones
| Cc: ghc-devs@haskell.org
| Subject: Re: can't get haddock patch
| 
| Simon Peyton Jones  writes:
| 
| > Ben
| > What does this mean? (below) Does it mean you have not pushed something
| to the haddock repo>
| > This happens when I'm on branch  wip/T9858-typeable-ben2, in the main
| repo
| >
| > Simon
| >
| > git submodule update
| >
| > fatal: reference is not a tree: 289ef817aad02c341beb6d4c28ba0495872f5a0f
| >
| This means that the commit listed doesn't appear to be a commit in the
| `haddock` repository.
| 
| I suspect I forgot to point out that the haddock changes are available
| in my Haddock repository on Github [1]. You would have needed to do
| something like this to see them,
| 
| $ cd utils/haddock
| $ git remote add bgamari git://github.com/bgamari/haddock
| $ git remote update
| 
| At which point you would have commit in question and could try `git
| submodule update` again.
| 
| Regardless, I can take care of it from here.
| 
| Cheers,
| 
| - Ben
| 
| 
| [1] https://github.com/bgamari/haddock/tree/T9858

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Warning suppression pragmas

2015-10-26 Thread Alexey Shmalko
Hi!

I think SUPPRESS could be enough.

Hope this helps

On Mon, Oct 26, 2015 at 8:59 PM, Эдгар Жаворонков
 wrote:
> Hi Ben!
> Thanks for your feedback
> I thought a little and fixed some in wiki page
>
> In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i
> can't come up with whort name that clearly describes purpose of such pragma
> =(
> Your suggestions are really welcome)
>
> ---
> С уважением,
> Жаворонков Эдгар
>
> Best regards,
> Edgar A. Zhavoronkov
>
> 2015-10-26 19:45 GMT+03:00 Ben Gamari :
>>
>> Эдгар Жаворонков  writes:
>>
>> > Hello Richard!
>> >
>> > Can you take a look at some sort of specification i wrote week ago?
>> > I placed it here:
>> > https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
>> > I can imagine only two use cases, and i'm not sure about correcteness of
>> > it
>> >
>> Thanks for writing this up!
>>
>> The specification is a good start but it really needs more detail. For
>> instance, what syntactic elements do you want this pragma to apply to?
>> Bindings? Expressions? Top-level definitions like classes, types, and
>> instances? Any lexical scope?
>>
>> It would be nice if the use-cases you mention were a bit more concrete.
>> It wouldn't hurt to mention particular warnings that you might imagine
>> that this would be useful for.
>>
>> It would likely be useful to draw inspiration from some of the schemes
>> used by other languages listed on the ticket (Rust and C# IIRC). It
>> wouldn't hurt to draw attention to the similarities and differences to
>> these other schemes in the proposal text.
>>
>> On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the
>> long side.
>>
>> Personally I would prefer not to see the pragma be bracketed as you
>> propose in your last example as its effect then becomes quite
>> "non-local". This pragma should, in my opinion, be a tool of precision,
>> used sparingly for well-understood reasons. Allowing bracketed regions
>> makes it too easy for definitions to "sneak in" to the supressed region,
>> hiding legitimate warnings. In the interest of keeping the proposal
>> concrete and concise I would either remove this alternative or move it
>> to a dedicated "Alternatives" section.
>>
>> I'm looking forward to seeing what becomes of this. You might consider
>> submitting the next iteration of the proposal to the Haskell subreddit
>> to get a few more eyes on it. Onwards!
>>
>> Cheers,
>>
>> - Ben
>>
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Can't build on Windows

2015-10-26 Thread Simon Peyton Jones
Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have any 
ideas?  Frustrating.
Oddly the symbol is defined in the .exe

bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame

02c248e0 T _stg_upd_frame_info
This is admittedly on a branch that I have modified; but I have only modified 
stuff in the front end, nothing in the RTS etc.  I suppose I will try to build 
a unmodified HEAD too.
can anyone help?  Thanks!
Simon


bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive

GHCi, version 7.11.20151026: http://www.haskell.org/ghc/  :? for help

ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'

ghc-stage2.exe: 
C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o: 
unknown symbol `_stg_upd_frame_info'

HEAD $
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Can't build on Windows

2015-10-26 Thread Simon Peyton Jones
But don't our windows buildbots do this for us?  Surely!  That's what they are 
for.

Me bisecting on my little laptop is not a very happy situation.  Don't we have 
better technology?

Simon

| -Original Message-
| From: mad@gmail.com [mailto:mad@gmail.com] On Behalf Of Austin
| Seipp
| Sent: 26 October 2015 23:37
| To: Simon Peyton Jones
| Cc: ghc-devs@haskell.org
| Subject: Re: Can't build on Windows
| 
| (Resending to list properly)
| 
| Hrm, I can't see anything off hand in the past few weeks that would
| have caused this at a glance.
| 
| Can you try bisecting it perhaps? You can probably do something like:
| 
| $ git bisect start
| $ git bisect bad
| $ git bisect good dcc342870b4d8a739ccbed3ae26e84dcc3579914
| $ git bisect run ./validate
| 
| This will probably take a while, though.
| 
| The commit 'dcc342870b4d8a739ccbed3ae26e84dcc3579914' was chosen
| randomly, however. Any idea when this started happening? If it's the
| past few weeks, the above might work
| 
| On Mon, Oct 26, 2015 at 4:19 PM, Simon Peyton Jones
|  wrote:
| > Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have
| any
| > ideas?  Frustrating.
| >
| > Oddly the symbol is defined in the .exe
| >
| > bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame
| >
| > 02c248e0 T _stg_upd_frame_info
| >
| > This is admittedly on a branch that I have modified; but I have only
| > modified stuff in the front end, nothing in the RTS etc.  I suppose I
| will
| > try to build a unmodified HEAD too.
| >
| > can anyone help?  Thanks!
| >
| > Simon
| >
| >
| >
| > bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive
| >
| > GHCi, version 7.11.20151026:
| https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.haskell
| .org%2fghc%2f=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c0ddd3793727
| 34905b9e108d2de5e53ad%7c72f988bf86f141af91ab2d7cd011db47%7c1=qOu5IQhF
| 9zwGyKO5nvAirOIC%2faHswQxRUDkSUQZGBGo%3d  :? for help
| >
| > ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'
| >
| > ghc-stage2.exe:
| > C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o:
| > unknown symbol `_stg_upd_frame_info'
| >
| > HEAD $
| >
| >
| > ___
| > ghc-devs mailing list
| > ghc-devs@haskell.org
| >
| https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskel
| l.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
| devs=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c0ddd379372734905b9e1
| 08d2de5e53ad%7c72f988bf86f141af91ab2d7cd011db47%7c1=q0prCf7bCbf3hCv0S
| wWCQ1Ps%2b4zJB31rMF34n%2fhBq0I%3d
| >
| 
| 
| 
| --
| Regards,
| 
| Austin Seipp, Haskell Consultant
| Well-Typed LLP,
| https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.well-
| typed.com%2f=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c0ddd37937273
| 4905b9e108d2de5e53ad%7c72f988bf86f141af91ab2d7cd011db47%7c1=jbueQwg9b
| CXMVdExfCrBmk9FIfLit2W5GZJNoKIGF8c%3d
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: recomp013

2015-10-26 Thread Edward Z. Yang
I couldn't repro on a devel2 build.

Edward

Excerpts from Simon Peyton Jones's message of 2015-10-26 08:24:00 -0700:
> driver/recomp013 is failing, on Linux, on HEAD for me:
> 
> Actual stdout output differs from expected:
> 
> --- ./driver/recomp013/recomp013.stdout.normalised2015-10-26 
> 14:26:51.920153558 +
> 
> +++ ./driver/recomp013/recomp013.run.stdout.normalised  2015-10-26 
> 14:26:51.920153558 +
> 
> @@ -3,5 +3,3 @@
> 
> [2 of 3] Compiling B( B.hs, B.o )
> 
> [3 of 3] Compiling C( C.hs, C.o )
> 
> second run
> 
> -[2 of 3] Compiling B( B.hs, B.o )
> 
> -[3 of 3] Compiling C( C.hs, C.o ) [B changed]
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build on Windows

2015-10-26 Thread Austin Seipp
(Resending to list properly)

Hrm, I can't see anything off hand in the past few weeks that would
have caused this at a glance.

Can you try bisecting it perhaps? You can probably do something like:

$ git bisect start
$ git bisect bad
$ git bisect good dcc342870b4d8a739ccbed3ae26e84dcc3579914
$ git bisect run ./validate

This will probably take a while, though.

The commit 'dcc342870b4d8a739ccbed3ae26e84dcc3579914' was chosen
randomly, however. Any idea when this started happening? If it's the
past few weeks, the above might work

On Mon, Oct 26, 2015 at 4:19 PM, Simon Peyton Jones
 wrote:
> Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have any
> ideas?  Frustrating.
>
> Oddly the symbol is defined in the .exe
>
> bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame
>
> 02c248e0 T _stg_upd_frame_info
>
> This is admittedly on a branch that I have modified; but I have only
> modified stuff in the front end, nothing in the RTS etc.  I suppose I will
> try to build a unmodified HEAD too.
>
> can anyone help?  Thanks!
>
> Simon
>
>
>
> bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive
>
> GHCi, version 7.11.20151026: http://www.haskell.org/ghc/  :? for help
>
> ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'
>
> ghc-stage2.exe:
> C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o:
> unknown symbol `_stg_upd_frame_info'
>
> HEAD $
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>



-- 
Regards,

Austin Seipp, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Can't build on Windows

2015-10-26 Thread Simon Peyton Jones
It happens with unmodified HEAD too.  Sigh.
Can anyone help?
Simon

From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Simon Peyton 
Jones
Sent: 26 October 2015 21:19
To: ghc-devs@haskell.org
Subject: Can't build on Windows

Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have any 
ideas?  Frustrating.
Oddly the symbol is defined in the .exe

bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame

02c248e0 T _stg_upd_frame_info
This is admittedly on a branch that I have modified; but I have only modified 
stuff in the front end, nothing in the RTS etc.  I suppose I will try to build 
a unmodified HEAD too.
can anyone help?  Thanks!
Simon


bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive

GHCi, version 7.11.20151026: http://www.haskell.org/ghc/  :? for help

ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'

ghc-stage2.exe: 
C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o: 
unknown symbol `_stg_upd_frame_info'

HEAD $
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build on Windows

2015-10-26 Thread Thomas Miedema
I can not reproduce this on 64bit
Windows, a9c93bdd8b027d6de09a3eada7721e7fd2d3e050 builds succesfully with
flavour devel2.

* Which build flavour are you using? Any other mk/build.mk settings?
* 32bit or 64bit?
* Output of `git status` (i.e. did you 'git submodule update'? In case that
fixes it, I suggest you use git pullall

for
all your pulling needs)
* Try `make maintainer-clean`.
* In case you use llvm, note that HEAD needs llvm-3.7 now.



On Mon, Oct 26, 2015 at 10:19 PM, Simon Peyton Jones 
wrote:

> Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have any
> ideas?  Frustrating.
>
> Oddly the symbol is defined in the .exe
>
> bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame
>
> 02c248e0 T _stg_upd_frame_info
>
> This is admittedly on a branch that I have modified; but I have only
> modified stuff in the front end, nothing in the RTS etc.  I suppose I will
> try to build a unmodified HEAD too.
>
> can anyone help?  Thanks!
>
> Simon
>
>
>
> bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive
>
> GHCi, version 7.11.20151026: http://www.haskell.org/ghc/  :? for help
>
> ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'
>
> ghc-stage2.exe:
> C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o:
> unknown symbol `_stg_upd_frame_info'
>
> HEAD $
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build on Windows

2015-10-26 Thread Edward Z. Yang
Same here, can't reproduce on 64bit Windows 10.

Edward

Excerpts from Thomas Miedema's message of 2015-10-26 17:54:35 -0700:
> I can not reproduce this on 64bit
> Windows, a9c93bdd8b027d6de09a3eada7721e7fd2d3e050 builds succesfully with
> flavour devel2.
> 
> * Which build flavour are you using? Any other mk/build.mk settings?
> * 32bit or 64bit?
> * Output of `git status` (i.e. did you 'git submodule update'? In case that
> fixes it, I suggest you use git pullall
> 
> for
> all your pulling needs)
> * Try `make maintainer-clean`.
> * In case you use llvm, note that HEAD needs llvm-3.7 now.
> 
> 
> 
> On Mon, Oct 26, 2015 at 10:19 PM, Simon Peyton Jones 
> wrote:
> 
> > Gurgah.   GHC is broken on my windows laptop.  See below.  Anyone have any
> > ideas?  Frustrating.
> >
> > Oddly the symbol is defined in the .exe
> >
> > bash$ nm inplace/bin/ghc-stage2.exe | grep stg_upd_frame
> >
> > 02c248e0 T _stg_upd_frame_info
> >
> > This is admittedly on a branch that I have modified; but I have only
> > modified stuff in the front end, nothing in the RTS etc.  I suppose I will
> > try to build a unmodified HEAD too.
> >
> > can anyone help?  Thanks!
> >
> > Simon
> >
> >
> >
> > bash$ c:/code/HEAD/inplace/bin/ghc-stage2 --interactive
> >
> > GHCi, version 7.11.20151026: http://www.haskell.org/ghc/  :? for help
> >
> > ghc-stage2.exe: unable to load package `ghc-prim-0.4.0.0'
> >
> > ghc-stage2.exe:
> > C:\code\HEAD\libraries\ghc-prim\dist-install\build\HSghc-prim-0.4.0.0.o:
> > unknown symbol `_stg_upd_frame_info'
> >
> > HEAD $
> >
> > ___
> > ghc-devs mailing list
> > ghc-devs@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >
> >
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: can't get haddock patch

2015-10-26 Thread Ben Gamari
Simon Peyton Jones  writes:

> Ben
> What does this mean? (below) Does it mean you have not pushed something to 
> the haddock repo>
> This happens when I'm on branch  wip/T9858-typeable-ben2, in the main repo
>
> Simon
>
> git submodule update
>
> fatal: reference is not a tree: 289ef817aad02c341beb6d4c28ba0495872f5a0f
>
This means that the commit listed doesn't appear to be a commit in the
`haddock` repository.

I suspect I forgot to point out that the haddock changes are available
in my Haddock repository on Github [1]. You would have needed to do
something like this to see them,

$ cd utils/haddock
$ git remote add bgamari git://github.com/bgamari/haddock
$ git remote update

At which point you would have commit in question and could try `git
submodule update` again.

Regardless, I can take care of it from here.

Cheers,

- Ben


[1] https://github.com/bgamari/haddock/tree/T9858



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Warning suppression pragmas

2015-10-26 Thread Эдгар Жаворонков
Hi Ben!
Thanks for your feedback
I thought a little and fixed some in wiki page

In my opinion SUPPRESS_WARNINGS is not a real long name for pragma, but i
can't come up with whort name that clearly describes purpose of such pragma
=(
Your suggestions are really welcome)

---
С уважением,
Жаворонков Эдгар

Best regards,
Edgar A. Zhavoronkov

2015-10-26 19:45 GMT+03:00 Ben Gamari :

> Эдгар Жаворонков  writes:
>
> > Hello Richard!
> >
> > Can you take a look at some sort of specification i wrote week ago?
> > I placed it here:
> > https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
> > I can imagine only two use cases, and i'm not sure about correcteness of
> it
> >
> Thanks for writing this up!
>
> The specification is a good start but it really needs more detail. For
> instance, what syntactic elements do you want this pragma to apply to?
> Bindings? Expressions? Top-level definitions like classes, types, and
> instances? Any lexical scope?
>
> It would be nice if the use-cases you mention were a bit more concrete.
> It wouldn't hurt to mention particular warnings that you might imagine
> that this would be useful for.
>
> It would likely be useful to draw inspiration from some of the schemes
> used by other languages listed on the ticket (Rust and C# IIRC). It
> wouldn't hurt to draw attention to the similarities and differences to
> these other schemes in the proposal text.
>
> On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the
> long side.
>
> Personally I would prefer not to see the pragma be bracketed as you
> propose in your last example as its effect then becomes quite
> "non-local". This pragma should, in my opinion, be a tool of precision,
> used sparingly for well-understood reasons. Allowing bracketed regions
> makes it too easy for definitions to "sneak in" to the supressed region,
> hiding legitimate warnings. In the interest of keeping the proposal
> concrete and concise I would either remove this alternative or move it
> to a dedicated "Alternatives" section.
>
> I'm looking forward to seeing what becomes of this. You might consider
> submitting the next iteration of the proposal to the Haskell subreddit
> to get a few more eyes on it. Onwards!
>
> Cheers,
>
> - Ben
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Sphinx on Windows

2015-10-26 Thread kyra

The Sphinx + GHC HEAD on Windows story is somewhat complicated.
Incidentally I've just managed to get it all working, thus I can share 
some of my knowledge:


1. Sphinx + GHC HEAD *doesn't work* on Windows if unmodified.

The problem is in 'mkUserGuidePart' utility. It crashes when trying to 
create utf8 encoded files when run in the console with default codepage. 
But if one changes console codepage to 65001 (chcp 65001) then 
'mkUserGuidePart' runs successfully *but* Sphinx stops working 
complaining it doesn't know what cp65001 encoding is. I've found that 
this fact is known to Python community but they won't fix it in any 
foreseeable future.


Thus, the only way to make *both* mkUserGuidePart and Sphinx work on 
windows is to modify mkUserGuidePart.

I've made the following quick fix for it:

diff -urN a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs
--- a/utils/mkUserGuidePart/Main.hs2015-10-08 14:09:24.0 +0300
+++ b/utils/mkUserGuidePart/Main.hs2015-10-24 21:42:41.321262400 +0300
@@ -7,6 +7,11 @@
 import Table
 import Options

+import System.IO
+
+writeFileUtf8 :: FilePath -> String -> IO ()
+writeFileUtf8 f txt = withFile f WriteMode (\ hdl -> hSetEncoding hdl 
utf8 >> hPutStr hdl txt)

+
 -- | A ReStructuredText fragment
 type ReST = String

@@ -27,7 +32,7 @@

 writeRestFile :: FilePath -> ReST -> IO ()
 writeRestFile fname content =
-  writeFile fname $ unlines
+  writeFileUtf8 fname $ unlines
 [ ".. This file is generated by utils/mkUserGuidePart"
 , ""
 , content

2. Regarding Python installation on Windows -- 2 options worked for me:
-- the simplest is to install WinPython (http://winpython.github.io/) 
which contains all necessary bits
-- more problematic is to install mingw-w64-x86_64-python2-sphinx 
(change x86_64 for i686 for 32-bit environment) from MSys2. It doesn't 
work out of the box and further fixes are necessary:
   -- the sphinx driver is called sphinx-build2 instead of sphinx-build 
thus one need to modify configure.ac accordingly
   -- the sphinx distribution itself is broken because python scripts 
are broken, for example, sphinx-build2-script.py starts with 
#!/usr/bin/env python2.exe which is wrong because thus it starts MSys2 
python (instead of MINGW python) which misses necessary packages. I've 
had to modify all related python scripts changing /usr/bin/env 
python2.exe to hardcoded MINGW python path.


Hope this helps.

Cheers,
Kyra

On 26.10.2015 10:59, Simon Peyton Jones wrote:


The GHC wiki says you need Sphinx to build docs,

https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools

and refers to the Preparation doc for how to install Sphinx

https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation

But the Windows sub-page of Preparation does not say how to install 
Sphinx.


Question: how does one install Sphinx on Windows?  The sphinx-doc home 
page mutters about ‘pip’, but I’ve never used that.  Does anyone have 
instructions?


Thanks

Simon



___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Warning suppression pragmas

2015-10-26 Thread Эдгар Жаворонков
Hello Richard!

Can you take a look at some sort of specification i wrote week ago?
I placed it here:
https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
I can imagine only two use cases, and i'm not sure about correcteness of it

---
С уважением,
Жаворонков Эдгар

Best regards,
Edgar A. Zhavoronkov

2015-10-20 1:44 GMT+03:00 Эдгар Жаворонков :

> Oh, okay, sure
>
> ---
> С уважением,
> Жаворонков Эдгар
>
> Yours sincerely,
> Zhavornkov Edgar
>
> 2015-10-20 1:37 GMT+03:00 Richard Eisenberg :
>
>> Sure. But before thinking about implementation, let's think about
>> specification. Write a wiki page (perhaps
>> https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with
>> the design of how the feature should work, with several examples. Once we
>> know what we're building, then we can talk about how to build it.
>>
>> Thanks!
>> Richard
>>
>> On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков 
>> wrote:
>>
>> Hello, Richard,
>>
>> Do you know something about defining own pragmas in GHC?
>>
>> ---
>>
>> С уважением,
>> Жаворонков Эдгар
>>
>> 2015-10-20 1:17 GMT+03:00 Richard Eisenberg :
>>
>>> Hi Edgar,
>>>
>>> No, that doesn't exist yet. Would surely be useful, though.
>>>
>>> Richard
>>>
>>> On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков 
>>> wrote:
>>>
>>> No, i mean exactly pragmas in source code, that i can particulary add to
>>> function or a part of the code for example.
>>> E.g:
>>>
>>> {-# BEGIN_SUPPRESS_WARNINGS #-}
>>>
>>> foo :: a -> b
>>> #do something that throws warnings
>>>
>>> {-# END_SUPPRESS_WARNINGS #-}
>>>
>>>
>>>
>>> 2015-10-20 1:10 GMT+03:00 Richard Eisenberg :
>>>
 I just responded to #602, but perhaps you're just looking for the
 -fno-warn-XXX options listed here:
 https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-reference.html#idp14879296

 Richard

 On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков 
 wrote:

 Hi everyone!

 Do you know, if there is pragma for warning suppression? I want to
 implement something like warning suppression related to this ticket in
 GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to
 implement that kind of pragma by myself?

 Thanks in advance!
 Edgar
 ___
 ghc-devs mailing list
 ghc-devs@haskell.org
 http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



>>>
>>>
>>
>>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Better calling conventions for strict functions (bang patterns)?

2015-10-26 Thread Simon Peyton Jones
Ryan

Yes, I’m sure there is room for improvement here!   Good observations.

In particular, while I’d like DATA to support this, I believe that most ‘eval’s 
find that the thing being evaluated is already evaluated; so the fast-path 
should be that case.  We should bet for evaluated.

NB, however, that the stack-overflow check applies to the entire function body. 
 Suppose we do
   f x = case x of (p,q) -> case p of True -> False; False -> True
Then we can eliminate the stack check only if both the eval of ‘x’ and the eval 
of ‘p’ both take the fast path.

Another avenue you might like to think about is this: if function f calls g, 
then g’s stack-overflow test could perhaps be absorbed into ‘f’s.  So
   f x = case (g x) of True -> False; False -> True
So maybe f could call a super-fast entry point for g that didn’t have a stack 
overflow test!

(Watch out: loops, recursion, etc)

I’m happy to advise.

Simon


From: Ryan Newton [mailto:rrnew...@gmail.com]
Sent: 23 October 2015 19:31
To: Simon Peyton Jones
Cc: ghc-devs@haskell.org; Ömer Sinan Ağacan; Ryan Scott; Chao-Hong Chen; Johan 
Tibell
Subject: Re: Better calling conventions for strict functions (bang patterns)?

Ah, yes, so just to give a concrete example in this thread, if we take the 
`foo` function above and say `map foo ls`, we may well get unevaluated 
arguments to foo.  (And this is almost precisely the same as the first example 
that Strict-Core paper!)

Thanks for the paper reference.  I read it and it's great -- just what I was 
looking for.  An approach that eliminates any jealousy of ML/Scheme compiler 
techniques vis a vis calling conventions ;-).  I'm also wondering if there are 
some incremental steps that can be taken, short of what is proposed in the 
paper.

  1.  Small tweaks: The CMM code above seems to be betting than the thunk is 
unevaluated, because it does the stack check and stack write before the 
predicate test that checks if the thunk is evaluated (if (R1 & 7 != 0) goto 
c3aO; else goto c3aP;).  With a bang-pattern function, couldn't it make the 
opposite bet?  That is, branch on whether the thunk is evaluated first, and 
then the wasted computation is only a single correctly predicted branch (and a 
read of a tag that we need to read anyway).
  2.  The option of multiple entrypoints which is considered and discarded as 
fragile in the beginning of the paper (for direct call vs indirect / 1st order 
vs higher order).  That fragile option is along the lines of what I wanted to 
discuss on this thread.  It does seem like a tricky phase ordering concern, but 
how bad is it exactly?  The conflict with the a case-expr rewrite is 
illustrated clearly in the paper, but that just means that such optimizations 
must happen before the final choice of which function entrypoint to call, 
doesn't it?  I'm not 100% sure where it could go in the current compiler 
pipeline, but couldn't the adjustment of call target from "foo" to 
"foo_with_known_whnf_args" happen quite late?
Cheers,
  -Ryan

P.S. One of the students CC'd, Ryan Scott, is currently on internship at Intel 
labs and is working to (hopefully) liberate the Intell Haskell Research 
Compiler as open source.  Like the 2009 paper, it also uses a strict IR, and I 
think it will be interesting to see exactly how it handles the conversion from 
Core to its IR.  (Probably the same as Fig 10 in the paper.)


On Fri, Oct 23, 2015 at 10:11 AM, Simon Peyton Jones 
> wrote:
It’s absolutely the case that bang patterns etc tell the caller what to do, but 
the function CANNOT ASSUME that its argument is evaluated.  Reason: higher 
order functions.

I think that the way to allow functions that can assume their arg is evaluated 
is through types: see Type are calling 
conventions.
  But it’d be a fairly big deal to implement.

Simon


From: ghc-devs 
[mailto:ghc-devs-boun...@haskell.org] On 
Behalf Of Ryan Newton
Sent: 23 October 2015 14:54
To: ghc-devs@haskell.org; Ömer Sinan Ağacan; Ryan 
Scott; Chao-Hong Chen; Johan Tibell
Subject: Better calling conventions for strict functions (bang patterns)?

Hi all,

With module-level Strict and StrictData pragmas coming soon, one obvious 
question is what kind of the code quality GHC can achieve for strict programs.

When it came up in discussion in our research group we realized we didn't 
actually know whether the bang patterns, `f !x`, on function arguments were 
enforced by caller or callee.

Here's a Gist that shows the compilation of a trivial function:


foo :: Maybe Int -> Int


foo !x =


  case x of


   Just y -> y


   

Re: [GHC] #11019: ApiAnnotations: Make all RdrName occurences Located

2015-10-26 Thread Alan & Kim Zimmerman
At the moment in HaRe we do use the wrapped location, but it results in
code that is much more complex. This change is more about bringing
predictability to the AST than anything else.

If anyone feels strongly that it should not happen then we can live without
it.

On Mon, Oct 26, 2015 at 2:11 PM, GHC  wrote:

> #11019: ApiAnnotations: Make all RdrName occurences Located
> -+-
> Reporter:  alanz |Owner:  alanz
> Type:  bug   |   Status:  new
> Priority:  normal|Milestone:  8.0.1
>Component:  Compiler  |  Version:  7.10.2
>   Resolution:| Keywords:
>  |  ApiAnnotations
> Operating System:  Unknown/Multiple  | Architecture:
>  |  Unknown/Multiple
>  Type of failure:  None/Unknown  |Test Case:
>   Blocked By:| Blocking:
>  Related Tickets:|  Differential Rev(s):
>Wiki Page:|
> -+-
>
> Comment (by goldfire):
>
>  Perhaps I'm missing something very simple, but if you have a, for example,
>  `LHsExpr Name` which matches the pattern `(L loc (HsVar name))`, the `loc`
>  should apply just as well to the `name` as to the overall expression. My
>  understanding of each of the cases above is that they all have this
>  property, so adding another `Located` wrapper would be redundant.
>
>  Or am I missing something?
>
> --
> Ticket URL: 
> GHC 
> The Glasgow Haskell Compiler
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Can't push to haddock repo

2015-10-26 Thread Ben Gamari
Simon Peyton Jones  writes:

> Well in utils/haddock/.git/config I see
> [remote "origin"]
>   url = git://git.haskell.org/haddock.git
>   pushurl = ssh://g...@git.haskell.org/haddock.git
>
Note the difference in hostnames,

   ssh://g...@git.haskell.org/haddock.git
 ssh://g...@github.com/haskell/haddock.git 

The point being, Haddock is hosted on Github. I believe the repo on
git.haskell.org is merely a mirror.

It's a bit hard to keep track of all of this at times, so the upstream
repositories are documented in the `packages` file at the root of the
GHC repository.

Cheers,

- Ben



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Can't push to haddock repo

2015-10-26 Thread Simon Peyton Jones
I can't update the haddock repository!   (I want to add a new branch for my 
in-flight work.)
Can anyone help?
Thanks
Simon


git push --set-upstream origin wip/spj-wildcard-refactor

remote: W refs/heads/wip/spj-wildcard-refactor haddock simonpj DENIED by refs/.*

remote: error: hook declined to update refs/heads/wip/spj-wildcard-refactor

To ssh://g...@git.haskell.org/haddock.git

! [remote rejected] wip/spj-wildcard-refactor -> wip/spj-wildcard-refactor 
(hook declined)

error: failed to push some refs to 'ssh://g...@git.haskell.org/haddock.git'

haddock $
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't push to haddock repo

2015-10-26 Thread Herbert Valerio Riedel

In the GHC tree:

$ grep haddock packages 
utils/haddock-   -   
ssh://g...@github.com/haskell/haddock.git

says that the upstream repo for Haddock is ssh://...

(there are some comments in the 'packages' file that explain what the
last column means)

so you have to do something like

  git push ssh://g...@github.com/haskell/haddock.git 
HEAD:wip/spj-wildcard-refactor

(the 'HEAD:' part may be optional, it just says, push what is the
current HEAD of your local repo to the remote branch wip/...)

HTH

On 2015-10-26 at 13:57:55 +0100, Simon Peyton Jones wrote:
> I can't update the haddock repository!   (I want to add a new branch for my 
> in-flight work.)
> Can anyone help?
> Thanks
> Simon
>
>
> git push --set-upstream origin wip/spj-wildcard-refactor
>
> remote: W refs/heads/wip/spj-wildcard-refactor haddock simonpj DENIED by 
> refs/.*
>
> remote: error: hook declined to update refs/heads/wip/spj-wildcard-refactor
>
> To ssh://g...@git.haskell.org/haddock.git
>
> ! [remote rejected] wip/spj-wildcard-refactor -> wip/spj-wildcard-refactor 
> (hook declined)
>
> error: failed to push some refs to 'ssh://g...@git.haskell.org/haddock.git'
>
> haddock $
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

-- 
"Elegance is not optional" -- Richard O'Keefe
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Can't push to haddock repo

2015-10-26 Thread Simon Peyton Jones
Well in utils/haddock/.git/config I see
[remote "origin"]
url = git://git.haskell.org/haddock.git
pushurl = ssh://g...@git.haskell.org/haddock.git

So that looks right.  Why would git push not work?

Simon

| -Original Message-
| From: Herbert Valerio Riedel [mailto:hvrie...@gmail.com]
| Sent: 26 October 2015 13:04
| To: Simon Peyton Jones
| Cc: ghc-devs@haskell.org
| Subject: Re: Can't push to haddock repo
| 
| 
| In the GHC tree:
| 
| $ grep haddock packages
| utils/haddock-   -
| ssh://g...@github.com/haskell/haddock.git
| 
| says that the upstream repo for Haddock is ssh://...
| 
| (there are some comments in the 'packages' file that explain what the
| last column means)
| 
| so you have to do something like
| 
|   git push ssh://g...@github.com/haskell/haddock.git HEAD:wip/spj-wildcard-
| refactor
| 
| (the 'HEAD:' part may be optional, it just says, push what is the
| current HEAD of your local repo to the remote branch wip/...)
| 
| HTH
| 
| On 2015-10-26 at 13:57:55 +0100, Simon Peyton Jones wrote:
| > I can't update the haddock repository!   (I want to add a new branch for
| my in-flight work.)
| > Can anyone help?
| > Thanks
| > Simon
| >
| >
| > git push --set-upstream origin wip/spj-wildcard-refactor
| >
| > remote: W refs/heads/wip/spj-wildcard-refactor haddock simonpj DENIED by
| refs/.*
| >
| > remote: error: hook declined to update refs/heads/wip/spj-wildcard-
| refactor
| >
| > To ssh://g...@git.haskell.org/haddock.git
| >
| > ! [remote rejected] wip/spj-wildcard-refactor -> wip/spj-wildcard-
| refactor (hook declined)
| >
| > error: failed to push some refs to
| 'ssh://g...@git.haskell.org/haddock.git'
| >
| > haddock $
| > ___
| > ghc-devs mailing list
| > ghc-devs@haskell.org
| >
| https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskel
| l.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
| devs=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c8b244454862541a00577
| 08d2de05db9f%7c72f988bf86f141af91ab2d7cd011db47%7c1=kCypWx5Kq7ffV9piW
| ItQNerjzDLU68rgHUacMsV%2f5pk%3d
| 
| --
| "Elegance is not optional" -- Richard O'Keefe
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Can't push to haddock repo

2015-10-26 Thread Simon Peyton Jones
ah yes, my bad. Thanks

|  -Original Message-
|  From: Ben Gamari [mailto:b...@well-typed.com]
|  Sent: 26 October 2015 13:55
|  To: Simon Peyton Jones; Herbert Valerio Riedel
|  Cc: ghc-devs@haskell.org
|  Subject: RE: Can't push to haddock repo
|  
|  Simon Peyton Jones  writes:
|  
|  > Well in utils/haddock/.git/config I see [remote "origin"]
|  >url = git://git.haskell.org/haddock.git
|  >pushurl = ssh://g...@git.haskell.org/haddock.git
|  >
|  Note the difference in hostnames,
|  
|  ssh://g...@git.haskell.org/haddock.git
|   ssh://g...@github.com/haskell/haddock.git
|  
|  The point being, Haddock is hosted on Github. I believe the repo on
|  git.haskell.org is merely a mirror.
|  
|  It's a bit hard to keep track of all of this at times, so the upstream
|  repositories are documented in the `packages` file at the root of the GHC
|  repository.
|  
|  Cheers,
|  
|  - Ben

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


recomp013

2015-10-26 Thread Simon Peyton Jones
driver/recomp013 is failing, on Linux, on HEAD for me:

Actual stdout output differs from expected:

--- ./driver/recomp013/recomp013.stdout.normalised2015-10-26 
14:26:51.920153558 +

+++ ./driver/recomp013/recomp013.run.stdout.normalised  2015-10-26 
14:26:51.920153558 +

@@ -3,5 +3,3 @@

[2 of 3] Compiling B( B.hs, B.o )

[3 of 3] Compiling C( C.hs, C.o )

second run

-[2 of 3] Compiling B( B.hs, B.o )

-[3 of 3] Compiling C( C.hs, C.o ) [B changed]
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Sphinx on Windows

2015-10-26 Thread Simon Peyton Jones
Thanks.  I'll just disable it for now.

When you have this sorted out, could you add something to the Windows 
instructions for GHC devs?  That'd be super-helpful

Simon

|  -Original Message-
|  From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of kyra
|  Sent: 26 October 2015 14:40
|  To: ghc-devs@haskell.org
|  Subject: Re: Sphinx on Windows
|  
|  The Sphinx + GHC HEAD on Windows story is somewhat complicated.
|  Incidentally I've just managed to get it all working, thus I can share some
|  of my knowledge:
|  
|  1. Sphinx + GHC HEAD *doesn't work* on Windows if unmodified.
|  
|  The problem is in 'mkUserGuidePart' utility. It crashes when trying to
|  create utf8 encoded files when run in the console with default codepage.
|  But if one changes console codepage to 65001 (chcp 65001) then
|  'mkUserGuidePart' runs successfully *but* Sphinx stops working complaining
|  it doesn't know what cp65001 encoding is. I've found that this fact is known
|  to Python community but they won't fix it in any foreseeable future.
|  
|  Thus, the only way to make *both* mkUserGuidePart and Sphinx work on windows
|  is to modify mkUserGuidePart.
|  I've made the following quick fix for it:
|  
|  diff -urN a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs
|  --- a/utils/mkUserGuidePart/Main.hs2015-10-08 14:09:24.0 +0300
|  +++ b/utils/mkUserGuidePart/Main.hs2015-10-24 21:42:41.321262400 +0300
|  @@ -7,6 +7,11 @@
|import Table
|import Options
|  
|  +import System.IO
|  +
|  +writeFileUtf8 :: FilePath -> String -> IO ()
|  +writeFileUtf8 f txt = withFile f WriteMode (\ hdl -> hSetEncoding hdl
|  utf8 >> hPutStr hdl txt)
|  +
|-- | A ReStructuredText fragment
|type ReST = String
|  
|  @@ -27,7 +32,7 @@
|  
|writeRestFile :: FilePath -> ReST -> IO ()
|writeRestFile fname content =
|  -  writeFile fname $ unlines
|  +  writeFileUtf8 fname $ unlines
|[ ".. This file is generated by utils/mkUserGuidePart"
|, ""
|, content
|  
|  2. Regarding Python installation on Windows -- 2 options worked for me:
|  -- the simplest is to install WinPython
|  (https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwinpython.g
|  ithub.io%2f=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c8b1e7e1d25f548
|  6c3b2e08d2de136222%7c72f988bf86f141af91ab2d7cd011db47%7c1=hreGbIXD5Fcq
|  HRYefVgz54Yr9UwsFjfXMui1MLZ97UI%3d)
|  which contains all necessary bits
|  -- more problematic is to install mingw-w64-x86_64-python2-sphinx (change
|  x86_64 for i686 for 32-bit environment) from MSys2. It doesn't work out of
|  the box and further fixes are necessary:
|  -- the sphinx driver is called sphinx-build2 instead of sphinx-build
|  thus one need to modify
|  https://na01.safelinks.protection.outlook.com/?url=configure.ac=01%7c01
|  %7csimonpj%40064d.mgd.microsoft.com%7c8b1e7e1d25f5486c3b2e08d2de136222%7c72f
|  988bf86f141af91ab2d7cd011db47%7c1=LkUUK8z66o9oJH3zM%2fVdZvwhEeOwaVzqYE
|  %2fue8NMrNU%3d accordingly
|  -- the sphinx distribution itself is broken because python scripts are
|  broken, for example,
|  https://na01.safelinks.protection.outlook.com/?url=sphinx-build2-
|  script.py=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c8b1e7e1d25f5486c
|  3b2e08d2de136222%7c72f988bf86f141af91ab2d7cd011db47%7c1=bwwa7fhpWKWWXE
|  QIHyopPVoPd0DiVb9p5HvkvoUVNis%3d starts with #!/usr/bin/env python2.exe
|  which is wrong because thus it starts MSys2 python (instead of MINGW python)
|  which misses necessary packages. I've had to modify all related python
|  scripts changing /usr/bin/env python2.exe to hardcoded MINGW python path.
|  
|  Hope this helps.
|  
|  Cheers,
|  Kyra
|  
|  On 26.10.2015 10:59, Simon Peyton Jones wrote:
|  >
|  > The GHC wiki says you need Sphinx to build docs,
|  >
|  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
|  >
|  > and refers to the Preparation doc for how to install Sphinx
|  >
|  > https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
|  >
|  > But the Windows sub-page of Preparation does not say how to install
|  > Sphinx.
|  >
|  > Question: how does one install Sphinx on Windows?  The sphinx-doc home
|  > page mutters about 'pip', but I've never used that.  Does anyone have
|  > instructions?
|  >
|  > Thanks
|  >
|  > Simon
|  >
|  >
|  >
|  > ___
|  > ghc-devs mailing list
|  > ghc-devs@haskell.org
|  > https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h
|  > askell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-devs=01%7c01%7csi
|  > monpj%40064d.mgd.microsoft.com%7c8b1e7e1d25f5486c3b2e08d2de136222%7c72
|  > f988bf86f141af91ab2d7cd011db47%7c1=8teFBXUzJgll4Eo0pBReMMOMd6v%2
|  > bdQQ1yhOp3u9M3og%3d
|  
|  ___
|  ghc-devs mailing list
|  ghc-devs@haskell.org
|  https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell
|  .org%2fcgi-bin%2fmailman%2flistinfo%2fghc-
|  

Re: Sphinx on Windows

2015-10-26 Thread Ben Gamari
kyra  writes:

> The Sphinx + GHC HEAD on Windows story is somewhat complicated.
> Incidentally I've just managed to get it all working, thus I can share 
> some of my knowledge:
>
Thanks for writing this down, Kyra! These notes are very helpful.

Would you like to add a comment to your patch describing the rationale
for the change and open a Phabricator Differential [1] so we can get it
upstream?

Cheers,

- Ben

[1] https://ghc.haskell.org/trac/ghc/wiki/Phabricator


signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Warning suppression pragmas

2015-10-26 Thread Эдгар Жаворонков
Hi Simon!

It is a name of particular warning. By the way, you made me think of more
general idea. So i think it would be enough to suppress all kinds of
warnings that a function can throw(and a bit easier for me as a total
newbee in GHC hacking =) )

---
С уважением,
Жаворонков Эдгар

Best regards,
Edgar A. Zhavoronkov

2015-10-26 18:19 GMT+03:00 Simon Peyton Jones :

> What is $warning_names$??
>
>
>
> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *?
> ??
> *Sent:* 26 October 2015 14:53
> *To:* Richard Eisenberg
> *Cc:* ghc-devs@haskell.org
> *Subject:* Re: Warning suppression pragmas
>
>
>
> Hello Richard!
>
>
>
> Can you take a look at some sort of specification i wrote week ago?
>
> I placed it here:
> https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
>
> I can imagine only two use cases, and i'm not sure about correcteness of it
>
>
> ---
>
> С уважением,
>
> Жаворонков Эдгар
>
>
>
> Best regards,
>
> Edgar A. Zhavoronkov
>
>
>
> 2015-10-20 1:44 GMT+03:00 Эдгар Жаворонков :
>
> Oh, okay, sure
>
>
> ---
>
> С уважением,
>
> Жаворонков Эдгар
>
>
>
> Yours sincerely,
>
> Zhavornkov Edgar
>
>
>
> 2015-10-20 1:37 GMT+03:00 Richard Eisenberg :
>
> Sure. But before thinking about implementation, let's think about
> specification. Write a wiki page (perhaps
> https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas ) with
> the design of how the feature should work, with several examples. Once we
> know what we're building, then we can talk about how to build it.
>
>
>
> Thanks!
>
> Richard
>
>
>
> On Oct 19, 2015, at 6:21 PM, Эдгар Жаворонков 
> wrote:
>
>
>
> Hello, Richard,
>
>
>
> Do you know something about defining own pragmas in GHC?
>
>
> ---
>
>
>
> С уважением,
>
> Жаворонков Эдгар
>
>
>
> 2015-10-20 1:17 GMT+03:00 Richard Eisenberg :
>
> Hi Edgar,
>
>
>
> No, that doesn't exist yet. Would surely be useful, though.
>
>
>
> Richard
>
>
>
> On Oct 19, 2015, at 6:16 PM, Эдгар Жаворонков 
> wrote:
>
>
>
> No, i mean exactly pragmas in source code, that i can particulary add to
> function or a part of the code for example.
>
> E.g:
>
>
>
> {-# BEGIN_SUPPRESS_WARNINGS #-}
>
>
>
> foo :: a -> b
>
> #do something that throws warnings
>
>
>
> {-# END_SUPPRESS_WARNINGS #-}
>
>
>
>
>
>
>
> 2015-10-20 1:10 GMT+03:00 Richard Eisenberg :
>
> I just responded to #602, but perhaps you're just looking for the
> -fno-warn-XXX options listed here:
> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flag-reference.html#idp14879296
> 
>
>
>
> Richard
>
>
>
> On Oct 19, 2015, at 5:22 PM, Эдгар Жаворонков 
> wrote:
>
>
>
> Hi everyone!
>
> Do you know, if there is pragma for warning suppression? I want to
> implement something like warning suppression related to this ticket in
> GHC's Trac (https://ghc.haskell.org/trac/ghc/ticket/602). Or i need to
> implement that kind of pragma by myself?
>
> Thanks in advance!
> Edgar
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> 
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: Segfault in a CoreLinted program (and a GHC-generated Core question)

2015-10-26 Thread Simon Peyton Jones
|  So my questions are: Am I right in assuming that CoreLint accepted programs
|  should not segfault?

Yes.  Modulo unsafeCoerce, and FFI calls.

| What about internal invariants? Should CoreLint check
|  for those? Is there any pass that checks for invariants and prints helpful
|  messages in case of a invariant invalidation?

Yes; they are documented in CoreSyn, which the data type, and Lint checks them.

|  As an attempt at debugging the code generated by my plugin, I wrote the
|  function that is supposed to be generated by my Core pass in Haskell and
|  compiled with GHC. Generated Core is mostly the same, except at one point it
|  has an extra lambda directly applied to a void#, something like ((\_ -> ...)
|  void#). Where can I learn more about why GHC is doing that?

Show me the code! 

Instead of generating

x :: Int# = 

GHC sometimes generates

x :: Void# -> Int# = \_ - 

and then calls (x void#), to make any div-zero failures happen at the right 
place.

I'm not sure if that is what you are seeing, but we can work it out when you 
give more detail.

Simon
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


can't get haddock patch

2015-10-26 Thread Simon Peyton Jones
Ben
What does this mean? (below) Does it mean you have not pushed something to the 
haddock repo>
This happens when I'm on branch  wip/T9858-typeable-ben2, in the main repo

Simon

git submodule update

fatal: reference is not a tree: 289ef817aad02c341beb6d4c28ba0495872f5a0f

Unable to checkout '289ef817aad02c341beb6d4c28ba0495872f5a0f' in submodule path 
'utils/haddock'

simonpj@cam-05-unx:~/code/HEAD-2$
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Segfault in a CoreLinted program (and a GHC-generated Core question)

2015-10-26 Thread Ben Gamari
Ömer Sinan Ağacan  writes:

> I have a very simple Core plugin that generates some functions. After my
> Core-to-Core pass is done, I'm running the linter to make sure the Core
> generated by my plugin is well-formed and well-typed. However, even though 
> lint
> checker passes, the code generated by my plugin is failing with a segfault.
>
...
>
> So my questions are: Am I right in assuming that CoreLint accepted programs
> should not segfault? What about internal invariants? Should CoreLint check for
> those? Is there any pass that checks for invariants and prints helpful 
> messages
> in case of a invariant invalidation?
>
My understanding is that CoreLint should (in principle) check all
internal invariants necessary to ensure the soundness of the Core. If a
Core program passes CoreLint it ought not to segfault. It sounds like
you found a bug in CoreLint.

> As an attempt at debugging the code generated by my plugin, I wrote the
> function that is supposed to be generated by my Core pass in Haskell and
> compiled with GHC. Generated Core is mostly the same, except at one point it
> has an extra lambda directly applied to a void#, something like ((\_ -> ...)
> void#). Where can I learn more about why GHC is doing that?
>
Hmm, interesting. I'm afraid I'm not sure what semantics void# has in
Core but it sure does sound fishy. Sadly grepping the source tree for
clues doesn't turn much up.

Simon, perhaps you could comment here?

Cheers,

- Ben



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Segfault in a CoreLinted program (and a GHC-generated Core question)

2015-10-26 Thread Ömer Sinan Ağacan
I have a very simple Core plugin that generates some functions. After my
Core-to-Core pass is done, I'm running the linter to make sure the Core
generated by my plugin is well-formed and well-typed. However, even though lint
checker passes, the code generated by my plugin is failing with a segfault.

I created a git repo for demonstration: https://github.com/osa1/plugins

This is where the CoreLint is happening:
https://github.com/osa1/plugins/blob/master/src/Plugins.hs#L38

I'm using GHC HEAD(it doesn't build with 7.10). Here's how to run:

Make sure GHC HEAD is in the $PATH, then

$ cabal install --with-ghc=ghc-stage2
$ cd test

Adding bunch of -ddump parameters here for debugging purposes:

$ ghc-stage2 -fplugin=Plugins --make Main.hs -fforce-recomp
-ddump-simpl -ddump-ds -ddump-to-file -ddump-stg

Now if you run the generated program, it should first print some numbers and
then segfault.

---

I heard from Simon in various talks(e.g. Haskell exchange 2015) that if lint
passes, then there should be no segfaults, so I thought this should be a bug.
I'm actually having some other problems with CoreLint too, for example, even
though Core lint passes, if I run Core simplifier pass after my plugin runs,
GHC is failing with various different panics. Some of those panics are
happening inside STG generation, not in simplifier(but it works fine if I
disable the simplifier!) It seems like CoreLint is not strict enough, it's not
checking some invariants that GHC simplifier and STG code generator are
assuming.

So my questions are: Am I right in assuming that CoreLint accepted programs
should not segfault? What about internal invariants? Should CoreLint check for
those? Is there any pass that checks for invariants and prints helpful messages
in case of a invariant invalidation?

As an attempt at debugging the code generated by my plugin, I wrote the
function that is supposed to be generated by my Core pass in Haskell and
compiled with GHC. Generated Core is mostly the same, except at one point it
has an extra lambda directly applied to a void#, something like ((\_ -> ...)
void#). Where can I learn more about why GHC is doing that?

Thanks.
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Warning suppression pragmas

2015-10-26 Thread Ben Gamari
Эдгар Жаворонков  writes:

> Hello Richard!
>
> Can you take a look at some sort of specification i wrote week ago?
> I placed it here:
> https://ghc.haskell.org/trac/ghc/wiki/Design/LocalWarningPragmas
> I can imagine only two use cases, and i'm not sure about correcteness of it
>
Thanks for writing this up!

The specification is a good start but it really needs more detail. For
instance, what syntactic elements do you want this pragma to apply to?
Bindings? Expressions? Top-level definitions like classes, types, and
instances? Any lexical scope?

It would be nice if the use-cases you mention were a bit more concrete.
It wouldn't hurt to mention particular warnings that you might imagine
that this would be useful for.

It would likely be useful to draw inspiration from some of the schemes
used by other languages listed on the ticket (Rust and C# IIRC). It
wouldn't hurt to draw attention to the similarities and differences to
these other schemes in the proposal text.

On a more bike-shed-y note, `SUPPRESS_WARNINGS` is arguably a bit on the
long side.

Personally I would prefer not to see the pragma be bracketed as you
propose in your last example as its effect then becomes quite
"non-local". This pragma should, in my opinion, be a tool of precision,
used sparingly for well-understood reasons. Allowing bracketed regions
makes it too easy for definitions to "sneak in" to the supressed region,
hiding legitimate warnings. In the interest of keeping the proposal
concrete and concise I would either remove this alternative or move it
to a dedicated "Alternatives" section.

I'm looking forward to seeing what becomes of this. You might consider
submitting the next iteration of the proposal to the Haskell subreddit
to get a few more eyes on it. Onwards!

Cheers,

- Ben



signature.asc
Description: PGP signature
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: [DISARMED] RE: Better calling conventions for strict functions (bang patterns)?

2015-10-26 Thread Andrew Farmer
Simon,

I really enjoyed reading this paper... I was wondering if you could comment
on the implementation of Strict Core? Was it ever implemented in GHC (even
as a proof-of-concept)? If not, was it just due to a lack of time or some
fundamental limitation or problem discovered after the paper? If it was
implemented, was any benefit actually measured? Can you speculate on
whether some of the more recent changes/additions to Core (such as
coercions and roles) might fit into this? (I don't see any obvious reason
they couldn't, but that is me.)

Thanks!
Andrew

On Fri, Oct 23, 2015 at 7:11 AM, Simon Peyton Jones 
wrote:

> It’s absolutely the case that bang patterns etc tell the caller what to
> do, but the function CANNOT ASSUME that its argument is evaluated.  Reason:
> higher order functions.
>
>
>
> I think that the way to allow functions that can assume their arg is
> evaluated is through types: see Type are calling conventions
> .
> But it’d be a fairly big deal to implement.
>
>
>
> Simon
>
>
>
>
>
> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Ryan
> Newton
> *Sent:* 23 October 2015 14:54
> *To:* ghc-devs@haskell.org; Ömer Sinan Ağacan; Ryan Scott; Chao-Hong
> Chen; Johan Tibell
> *Subject:* Better calling conventions for strict functions (bang
> patterns)?
>
>
>
> Hi all,
>
>
>
> With module-level Strict and StrictData pragmas coming soon, one obvious
> question is what kind of the code quality GHC can achieve for strict
> programs.
>
>
>
> When it came up in discussion in our research group we realized we didn't
> actually know whether the bang patterns, `f !x`, on function arguments were
> enforced by caller or callee.
>
>
>
> Here's a Gist that shows the compilation of a trivial function:
>
> foo :: Maybe Int -> Int
>
> foo !x =
>
>   case x of
>
>Just y -> y
>
>
>
>*MailScanner has detected a possible fraud attempt from
> "na01.safelinks.protection.outlook.com" claiming to be*
> https://gist.github.com/rrnewton/1ac722189c65f26fe9ac
> 
>
>
>
> If that function is compiled to *assume* its input is in WHNF, it should
> be just as efficient as the isomorphic MLton/OCaml code, right?  It only
> needs to branch on the tag, do a field dereference, and return.
>
>
>
> But as you can see from the STG and CMM generated, foo *does indeed*
> enter the thunk, adding an extra indirect jump.  Here's the body:
>
>   c3aY:
>
>   if ((Sp + -8) < SpLim) goto c3aZ; else goto c3b0;
>
>   c3aZ:
>
>   // nop
>
>   R1 = PicBaseReg + foo_closure;
>
>   call (I64[BaseReg - 8])(R2, R1) args: 8, res: 0, upd: 8;
>
>   c3b0:
>
>   I64[Sp - 8] = PicBaseReg + block_c3aO_info;
>
>   R1 = R2;
>
>   Sp = Sp - 8;
>
>   if (R1 & 7 != 0) goto c3aO; else goto c3aP;
>
>   c3aP:
>
>   call (I64[R1])(R1) returns to c3aO, args: 8, res: 8, upd: 8;
>
>   c3aO:
>
>   if (R1 & 7 >= 2) goto c3aW; else goto c3aX;
>
>   c3aW:
>
>   R1 = P64[R1 + 6] & (-8);
>
>   Sp = Sp + 8;
>
>   call (I64[R1])(R1) args: 8, res: 0, upd: 8;
>
>   c3aX:
>
>   R1 = PicBaseReg + lvl_r39S_closure;
>
>   Sp = Sp + 8;
>
>   call (I64[R1])(R1) args: 8, res: 0, upd: 8;
>
>
>
>
>
> The call inside c3aP is entering "x" as a thunk, which also incurs all of
> the stack limit check code.  I believe that IF the input could be assumed
> to be in WHNF, everything above the label "c3aO" could be omitted.
>
>
>
> So... if GHC is going to be a fabulous pure *and* imperative language,
> and a fabulous lazy *and* strict compiler/runtime.. is there some work we
> can do here to improve this situation? Would the following make sense:
>
>- Put together a benchmark suite of all-strict programs with
>Strict/StrictData (compare a few benchmark's generated code to MLton, if
>time allows)
>- Modify GHC to change calling conventions for bang patterns -- caller
>enforces WHNF rather than callee.  Existing strictness/demand/cardinality
>analysis would stay the same.
>
> Unless there's something I'm really missing here, the result should be
> that you can have a whole chain of strict function calls, each of which
> knows its arguments and the arguments it passes to its callees are all in
> WHNF, without ever generating thunk-entry sequences.
>
>
>
> Thanks for your time,
>
>   -Ryan
>
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
___
ghc-devs mailing list