ku-fpg / sunroof-compiler

Monadic Javascript Compiler
BSD 3-Clause "New" or "Revised" License
73 stars 6 forks source link

Add a stand alone version of sunroof compiler #6

Closed andygill closed 11 years ago

andygill commented 11 years ago

This will need

andygill commented 11 years ago

Implemented a basic static compiler.

staticCompiler :: CompilerOpts -> String -> JS t () -> IO String

where the string is the function name.

staticCompiler def "main" (alert (js "Hello, World")) "var main = function() {\n alert(\"Hello, World\");\n};"

Can be called from index.html, via main();