[Haskell-cafe] Caching functions compiled with llvm-hs

Tom Westerhout kot.tom97 at gmail.com
Sun Jul 12 10:28:06 UTC 2020


On 11/07/2020, Georgi Lyubenov <godzbanebane at gmail.com> wrote:
> Is there something wrong with your idea? (other than ideological issues
> with unsafePerformIO - I guess then the standard approach would be to use
> some State holding your compiled functions or a Reader over an MVar holding
> your compiled functions)

The part that feels wrong here is that one has to create a new Module
for every single function. I always thought of LLVM Modules as kind of
compilation units. Or is this an okay-ish approach?

>
> The only thing you should make sure to do is add a NOINLINE to wherever the
> unsafePerformIO is, so that it doesn't get inlined and executed more than
> once.

Oh I totally forgot! Thank you for reminding!


Cheers,
Tom


More information about the Haskell-Cafe mailing list