[compiler-hacking] @inline attribute?
Leo White
lpw25 at cam.ac.uk
Thu Oct 30 14:42:06 GMT 2014
> I'm interested in people's thoughts on adding an @inline attribute,
> along the lines of GHC's {-# INLINE #-}:
>
> https://www.haskell.org/ghc/docs/7.0.2/html/users_guide/pragmas.html#inline-noinline-pragma
>
> It'd be useful to have a way of encouraging the compiler to inline
> functions which its own heuristics might discount as too large or
> otherwise too expensive.
I'd like it to go one step further and give a warning or error if
inlining could not be done for some reason (e.g. .cmx file not
present). I think this is very much inline with OCaml's philosophy of
predictable performance -- rather than just hope that the compiler
inlines something I can be certain of it.
Regards,
Leo
More information about the Cam-compiler-hacking
mailing list