[Haskell-cafe] ghci & ghc -> JS (Emscripten)
blackbox.dev.ml at gmail.com
Wed Jul 3 12:26:26 CEST 2013
Thank you for your response :)
Could you please answer one additional question - why you, while creating
GHCJS didn't base on emscripten? Why haven't you patched it and created
Is GHCJS "production ready"? Also - Can I use GHCJS to compile big projects
When you mentioned the file sizes I thought it would be good to further
introduce what we are trying to do.
We want to be able to send a haskell code to a server to compile it and
return the resulted JS to user as a compiled library. We want users to be
able to connect these compiled functions together to get some interactive
for example: user is creating 2 functions (pseudocode): a(x) and b(x). They
are send to server and compiled to JS. Then in an online tool user is
connecting (visually with lines) a data (lets say a list of ints)  -> a
-> b. While connecting it we want this tool to "interpret" such connections
and visualise the data on each step - so we want to have some kind of
"runtime" or "interpreter" on client side.
2013/7/3 Luite Stegeman <stegeman at gmail.com>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe