RE: How do you stop functions being inlined?
In fact, GHC understands both NOINLINE and NOTINLINE with any capitalisation. We just tend to use NOINLINE because I think GHC had it before notInline was mentioned in the report. Cheers, Simon
-----Original Message----- From: Julian Seward (Intl Vendor) [mailto:v-julsew@microsoft.com] Sent: Thursday, August 02, 2001 10:31 AM To: George Russell; haskell@haskell.org Subject: RE: How do you stop functions being inlined?
{-# NOINLINE name #-}
| -----Original Message----- | From: George Russell [mailto:ger@tzi.de] | Sent: Wednesday, August 01, 2001 3:46 PM | To: haskell@haskell.org | Subject: How do you stop functions being inlined? | | | Well, I think we all know the answer to this one, namely | {-# NOINLINE [name] #-} | This is, after all, what GHC does, and what several of the | files in ghc/fptools do. | | Only slight problem is that according to the Haskell 98 | report, including Simon Peyton Jones' revised draft, you | should use: | {-# notInline [name] #-} | Most of the time in fptools/hslibs (which I have from | GHC), NOINLINE is used, but in one case notInline is used. | | Of course one of the delights of pragmas is that the | "pragma should be ignored if an implementation is not prepared to | handle it.". So if you guess wrong, you may never know, | until you get a mysterious bug from GHC inlining a call to | create a global variable via unsafePerformIO. Aren't pragmas | wonderful? | | Would someone tell me which we are supposed to use? Or | should I use both "NOINLINE" and "notInline", just to be on | the safe side? | | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Simon Marlow wrote:
In fact, GHC understands both NOINLINE and NOTINLINE with any capitalisation. We just tend to use NOINLINE because I think GHC had it before notInline was mentioned in the report.
[snip] So why does the GHC documentation only document NOINLINE? Is this a secret Microsoft plot to get to use non-standard features and stop us switching later to Turbo Haskell? 8-) 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.
participants (2)
-
George Russell -
Simon Marlow