foreign import ccall "dynamic" exprFun :: FunPtr (IO Float) -> IO Float
main :: IO ()
main = do
AST.Program asts <- read <$> getContents
foreign import ccall "dynamic" exprFun :: FunPtr (IO Float) -> IO Float
main :: IO ()
main = do
AST.Program asts <- read <$> getContents
withMCJIT ctx Nothing Nothing Nothing Nothing $ \mcjit ->
withModuleFromAST ctx mdl $ \mdl' ->
withPassManager defaultCuratedPassSetSpec $ \pm -> do
withMCJIT ctx Nothing Nothing Nothing Nothing $ \mcjit ->
withModuleFromAST ctx mdl $ \mdl' ->
withPassManager defaultCuratedPassSetSpec $ \pm -> do
let bindMap = Map.fromList (zip paramStrs binds)
buildExpr bindMap body >>= ret
where params = zip (repeat float) (map fromString paramStrs)
buildAST (AST.Eval e) =
function "expr" [] float $ \_ -> buildExpr mempty e >>= ret
let bindMap = Map.fromList (zip paramStrs binds)
buildExpr bindMap body >>= ret
where params = zip (repeat float) (map fromString paramStrs)
buildAST (AST.Eval e) =
function "expr" [] float $ \_ -> buildExpr mempty e >>= ret