RE: How do you stop functions being inlined?
| I think in the light of the current situation, it would be | better if the Haskell standard for pragmas were changed to specify: | (1) NOTINLINE is a synonym for NOINLINE. | (2) Case in the first word of a pragma is ignored (which | everyone seems to | be assuming but isn't specified anywhere). | (3) Perhaps also SPECIALISE as a synonym for SPECIALIZE, like | GHC. It does seem to me particularly important that we should | standardise pragmas as much as possible, given that pragmas | not recognised get ignored. OK. For the Haskell 98 report I propose 1. Change "notInline" to "NOINLINE". 2. Change "specialize" to "SPECIALIZE" 3. Delete E.3 (optimize pragma) altogether Rationale a) Only GHC understands notinline/noinline, and everyone uses "noinline", which seems more gramatical. Hence the change. b) I'd rather not specify alternative spellings in the language report. Let's stick to one. (Fewer changes too.) c) It would break a lot of programs to insist on the current Report's lower-case pragma names. We could say that the thing is case-insensitive, but that's inconsistent with the rest of the language. Hence I propose upper case. Of course, compilers are free to be a bit more liberal, but my inclination is to be specific in the language report. d) No compiler implements the "optimize" pragma, and we need practical experience before fixing on a language design. Reading Appendix E I have only just realised that this pragma is specified, and it seems way over the top to me. Caveat This proposal is arguably GHC-centric, since it makes the report match GHC. On the other hand, GHC is an optimising compiler, which is what pragmas are for. Simon
"Simon Peyton-Jones" <simonpj@microsoft.com> wrote,
| I think in the light of the current situation, it would be | better if the Haskell standard for pragmas were changed to specify: | (1) NOTINLINE is a synonym for NOINLINE. | (2) Case in the first word of a pragma is ignored (which | everyone seems to | be assuming but isn't specified anywhere). | (3) Perhaps also SPECIALISE as a synonym for SPECIALIZE, like | GHC. It does seem to me particularly important that we should | standardise pragmas as much as possible, given that pragmas | not recognised get ignored.
OK. For the Haskell 98 report I propose
1. Change "notInline" to "NOINLINE". 2. Change "specialize" to "SPECIALIZE" 3. Delete E.3 (optimize pragma) altogether
Excellent plan. Manuel
On Fri, 17 Aug 2001, Simon Peyton-Jones wrote:
Caveat
This proposal is arguably GHC-centric, since it makes the report match GHC. On the other hand, GHC is an optimising compiler, which is what pragmas are for.
Well, GHC and the report still differ. They have different semantics for the INLINE pragma. The report says that the optional digit specifies at what level of optimization the inlining should trigger. GHC on the other hand uses the digit for determining which inlining pass should inline the function. Maybe the optional digit in the INLINE pragma should be removed in the report? Cheers, /Josef
participants (3)
-
Josef Svenningsson -
Manuel M. T. Chakravarty -
Simon Peyton-Jones