Yeah I know its JavascriptCore, but until one of us write mkDynamicForeign
or
relaxes mkForeigns
literal string argument restriction during the type provider phase, we're stuck with
this.
-
Clone the repo
-
Run
script/bootstrap
-
Compile Idris from joshvera/main-js or
-
Since the Javascript Idris backend assumes a
document
orwindow
object exists in the JS execution context and JavaScriptCore has neither, we need to modify the generatedmain
function:var main = function(){ if (document.readyState == "complete" || document.readyState == "loaded") { __IDRRT__tailcall(function(){ return __IDR__mrunMain0() }); } else { window.addEventListener("DOMContentLoaded",function(){ __IDRRT__tailcall(function(){ return __IDR__mrunMain0() }) },false); } } // To: var main = function(){ __IDRRT__tailcall(function(){ return __IDR__mrunMain0() }); }
-
Run it.
Pull Requests Welcome! 😄