<div dir="ltr">Thank you for your response :)<div>Could you please answer one additional question - why you, while creating GHCJS didn&#39;t base on emscripten? Why haven&#39;t you patched it and created custom solution?</div>
<div>Is GHCJS &quot;production ready&quot;? Also - Can I use GHCJS to compile big projects (like GHC or GHCI) to Javascript?</div><div><br></div><div>When you mentioned the file sizes I thought it would be good to further introduce what we are trying to do. </div>
<div>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 results.</div>
<div>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) [] -&gt; a -&gt; b. While connecting it we want this tool to &quot;interpret&quot; such connections and visualise the data on each step - so we want to have some kind of &quot;runtime&quot; or &quot;interpreter&quot; on client side.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/3 Luite Stegeman <span dir="ltr">&lt;<a href="mailto:stegeman@gmail.com" target="_blank">stegeman@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im">On Wed, Jul 3, 2013 at 11:06 AM, B B <span dir="ltr">&lt;<a href="mailto:blackbox.dev.ml@gmail.com" target="_blank">blackbox.dev.ml@gmail.com</a>&gt;</span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Emscripten is meant to translate ANY LLVM IR code to javascript and it should work (as I belive). </div>

</blockquote><div><br></div></div><div>It cannot compile ANY LLVM code: It&#39;s heavily geared towards porting C and C++ code to JavaScript, and still there are some limitatons, see:</div><div><br></div><div>
<a href="https://github.com/kripken/emscripten/wiki/CodeGuidelinesAndLimitations" target="_blank">https://github.com/kripken/emscripten/wiki/CodeGuidelinesAndLimitations</a><br></div><div> </div><div>Also the FAQ mentions how event loops should be converted to something that emscripten can deal with:</div>

<div><br></div><div><a href="https://github.com/kripken/emscripten/wiki/FAQ" target="_blank">https://github.com/kripken/emscripten/wiki/FAQ</a><br></div><div><br></div><div>Since the GHC runtime never returns, you&#39;d probably have to do something similar.</div>
<div class="im">
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>I&#39;ve tried to compile &#39;hello wrold&#39; Haskell program to JS using Emscripten but I faced a problem, that in generated LLVM IR code there is no C-like main function (<a href="https://github.com/kripken/emscripten/issues/500" target="_blank">https://github.com/kripken/emscripten/issues/500</a>) so there has to be a runtime library that has to be linked and will run the code - is this &quot;RTS&quot; or something else?</div>


<div>If its RTS I understeand I should compile it to javascript and then provide it as a library to emscripten? Do you have a working RTS js version?</div><div><br></div></div></blockquote><div><br></div></div><div>I don&#39;t have a working version. The files you need are probably mostly in the rts directory of the GHC repository: <a href="https://github.com/ghc/ghc/tree/master/rts" target="_blank">https://github.com/ghc/ghc/tree/master/rts</a> , but you might need a bit more, like libffi and gmp (unless you use integer-simple).</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div>I want to simply try emscripten and see how it performs on such GHC generater LLVM IRs.</div>

</div></blockquote><div><br></div></div><div>I don&#39;t think it&#39;s that easy... I&#39;d expect a few weeks of work minimum to get very simple examples like &quot;Hello, world&quot; working. And a few months for something big like GHC.</div>

<div><br></div><div>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 100MB of JavaScript wouldn&#39;t be terribly surprising.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div> luite</div></font></span></div></div></div>
</blockquote></div><br></div>