How do you stop functions being inlined?

Simon Peyton-Jones simonpj@microsoft.com
Fri, 17 Aug 2001 10:32:05 -0700


| I think in the light of the current situation, it would be=20
| 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=20
| everyone seems to
|     be assuming but isn't specified anywhere).
| (3) Perhaps also SPECIALISE as a synonym for SPECIALIZE, like=20
| GHC. It does seem to me particularly important that we should=20
| standardise pragmas as much as possible, given that pragmas=20
| 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. =20

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