-main = do
- withContext $ \ctx -> withHostTargetMachineDefault $ \tm -> do
- ast <- runReaderT (buildModuleT "main" repl) ctx
+main =
+ withContext $ \ctx -> withHostTargetMachineDefault $ \tm ->
+ withExecutionSession $ \exSession ->
+ withSymbolResolver exSession (SymbolResolver symResolver) $ \symResolverPtr ->
+ withObjectLinkingLayer exSession (const $ pure symResolverPtr) $ \linkingLayer ->
+ withIRCompileLayer linkingLayer tm $ \compLayer ->
+ withModuleKey exSession $ \mdlKey -> do
+ let env = JITEnv ctx compLayer mdlKey
+ _ast <- runReaderT (buildModuleT "main" repl) env