[Haskell-cafe] ghci & ghc -> JS (Emscripten)
stegeman at gmail.com
Wed Jul 3 11:32:53 CEST 2013
On Wed, Jul 3, 2013 at 11:06 AM, B B <blackbox.dev.ml at gmail.com> wrote:
> should work (as I belive).
It cannot compile ANY LLVM code: It's heavily geared towards porting C and
Also the FAQ mentions how event loops should be converted to something that
emscripten can deal with:
Since the GHC runtime never returns, you'd probably have to do something
I've tried to compile 'hello wrold' Haskell program to JS using Emscripten
> but I faced a problem, that in generated LLVM IR code there is no C-like
> main function (https://github.com/kripken/emscripten/issues/500) so there
> has to be a runtime library that has to be linked and will run the code -
> is this "RTS" or something else?
> provide it as a library to emscripten? Do you have a working RTS js version?
I don't have a working version. The files you need are probably mostly in
the rts directory of the GHC repository:
https://github.com/ghc/ghc/tree/master/rts , but you might need a bit more,
like libffi and gmp (unless you use integer-simple).
> I want to simply try emscripten and see how it performs on such GHC
> generater LLVM IRs.
I don't think it's that easy... I'd expect a few weeks of work minimum to
get very simple examples like "Hello, world" working. And a few months for
something big like GHC.
Also keep in mind that the code will probably be pretty big, GHC (and GHCi,
which is the same file) is ~65MB on my linux system, so getting well over
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe