Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-06-28 Thread Luite Stegeman
I don't know of any complete implementation. The LLVM code produced by GHC might be hard to compile to JavaScript, since JS does not have tail call optimization. You would also need to get the RTS working, including the garbage collector. It's written in C and Cmm, both of which can be compiled to

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-02 Thread Luite Stegeman
On Tue, Jul 2, 2013 at 4:38 PM, B B wrote: > Thank you for all the replies. > Luite Stegeman - I was thinking that the LLVM IR code is optimized already > or you can run LLVM IR optimization passes to get rid of such things. I > think compiling with ghc -fllvm generates LLVM bitcode

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-03 Thread Luite Stegeman
On Wed, Jul 3, 2013 at 11:06 AM, B B wrote: > Emscripten is meant to translate ANY LLVM IR code to javascript and it > should work (as I belive). > It cannot compile ANY LLVM code: It's heavily geared towards porting C and C++ code to JavaScript, and still there are some limitatons, see: https:

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-03 Thread Luite Stegeman
On Wed, Jul 3, 2013 at 12:26 PM, B B wrote: > 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 > custom solution? > I didn't know a good way to get the tail calling

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-03 Thread Luite Stegeman
On Wed, Jul 3, 2013 at 3:13 PM, B B wrote: > >>> I think GHCJS should be able to compile all Haskell code in GHC, but we >> haven't tested this yet. The tricky bit is probably getting foreign code >> work, and creating a working installation that includes all other things, >> like libraries and a

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-03 Thread Luite Stegeman
> Similarly I would expect that generating any sort of sensible Javascript > would require something fairly tightly tied to GHC; otherwise the output's > going to have horrible performance because it's not going to understand the > input and will fall back to the slowest but most general translatio

Re: [Haskell-cafe] GHC 7.8 (GHCJS)

2013-07-03 Thread Luite Stegeman
That's just a joke, because GHCJS is a bit tricky to install, but it will be easier after 7.8 is released and they have merged our patches (unless you really are from the future, then you can just install it, but please send me the code of all the bugs i'll have fixed by then). The easiest way to

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Luite Stegeman
On Wed, Sep 4, 2013 at 6:32 PM, Daniil Frumin wrote: > > > I think it's nice that you've raised that question, I will think about > implementing a finer API for calling Haskell from JS. > > It sounds like something like h$runSyncWithResult (name open for bikeshedding) that takes an IO (JSRef a) a

[Haskell-cafe] Diffs for hackage

2011-08-12 Thread Luite Stegeman
hi all, often when a new version of a package is available on hackage, I want to see what has changed since the previous release. Unfortunately many packages don't have a changelog or a public source code repository. That's why I have made a simple website with git repositories that contain all ve