Better calling conventions for strict functions (bang patterns)?

2015-10-23 Thread Ryan Newton
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

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

2015-10-23 Thread Simon Peyton Jones
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

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

2015-10-23 Thread Ryan Newton
> > >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 >

Re: Context for typed holes

2015-10-23 Thread David Feuer
I just closed mine as a duplicate of yours. On Oct 23, 2015 1:55 AM, "Andres Löh" wrote: > Actually, #9091 was the one I was really looking for ... reported by > me. See also the discussion about "given" vs. "wanted" constraints. > > Cheers, > Andres > > On Fri, Oct 23,

RE: Context for typed holes

2015-10-23 Thread Simon Peyton Jones
Indeed. Please also do give concrete examples, so that we all talk about the same proposal. Simon From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Manuel M T Chakravarty Sent: 23 October 2015 00:16 To: David Feuer Cc: ghc-devs Subject: Re: Context for typed holes I think,

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

2015-10-23 Thread Ryan Newton
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