PUBLIC
I can look into this, sure, but it wouldn’t exactly solve my original problem, which is that I would like to turn this on wholesale, not definition
by definition. It seems that all past discussion about this was in the context of a per-definition pragma (and sadly, a large part of that was bikeshedding over the name of the pragma…). But is the reason for that spelled out explicitly somewhere? In other
words, what is the cost of specialisation, why would I ever not want to specialize a definition (inlinable or not)? I’d like to understand this first before reviving the proposal.
From: ghc-devs <ghc-devs-bounces@haskell.org>
On Behalf Of Simon Peyton Jones
Sent: Friday, May 6, 2022 5:26 PM
To: Oleg Grenrus <oleg.grenrus@iki.fi>; ÉRDI Gergõ <gergo@erdi.hu>
Cc: GHC developers <ghc-devs@haskell.org>
Subject: [External] Re: Specialising NOINLINE functions
There is a (stale) ghc-proposal for that,
https://github.com/ghc-proposals/ghc-proposals/pull/357
So there is! Thank you.
Gergo: would you like to take over this proposal, revise it if necessary in the light of the comments, and submit it?
Simon
On Fri, 6 May 2022 at 10:08, Oleg Grenrus <oleg.grenrus@iki.fi> wrote:
There is a (stale) ghc-proposal for that,
https://github.com/ghc-proposals/ghc-proposals/pull/357
- Oleg
On 6.5.2022 12.04, Simon Peyton Jones wrote:
> Dear devs
>
> At the moment the INLINEABLE pragma means "capture my right-hand side,
> regardless of how big it is, so that it can be type-class-specialised,
> including in other modules". But it /also /says "feel free to inline me".
>
> Some users (eg Gergo) want to say NOINLINE on some functions. But for
> these they'd still like to generate type-class-specialised versions.
> After all, if we aren't going to inline them, specialising is the next
> best thing.
>
> But we have no way to say both "specialise me" and "don't inline me",
> because you can't say both INLINEABLE and NOINLINE. (That would look
> silly.)
>
> I think we should probably just bite the bullet and add a
> SPECIALISABLE pragma, /orthogonal to INLINE/NOINLNE/, which say
> "capture my right-hand side, regardless of how big it is, so that it
> can be type-class-specialised, including in other modules". It
> behaves exactly like INLINEABLE except that you can specify it along
> with INLINE/NOINLINE.
>
> Any thoughts? Do you think this needs a GHC proposal?
>
> See #21036 <https://gitlab.haskell.org/ghc/ghc/-/issues/21036#note_407930>
>
>
> 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