Find our JIT'ed function and run it
authorLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:33:35 +0000 (19:33 +0100)
committerLuke Lau <luke_lau@icloud.com>
Thu, 7 Nov 2019 17:11:27 +0000 (17:11 +0000)
commitbc95ec9770ea2b19dd773dd4cec05d61b4684e95
treefed013c927d22ff6fe9c732427f1bb1a53a23b16
parent18c4b939a6ba1099cd7296b839428f829533f3c8
Find our JIT'ed function and run it

Here is where the magic happens. We first mangle the symbol before
passing it to findSymbolIn: The compilation then happens here. It will
spit back a FFI pointer, which we then need to invoke ourselves.

In order to do this we have to specify the Haskell type of the function
that we're pointing to, which resides in C-land, hence the ccall
attribute in our foreign declaration.

Try it out!
Main.hs