[Haskell-cafe] GHCJS/Firefox support for forkIO and MVars

18 views
Skip to first unread message

Hamish Mackenzie

unread,
May 30, 2011, 11:53:37 AM5/30/11
to Haskell Cafe
Firstly a big thanks to Neil Mix for this threading library...
http://www.neilmix.com/2007/02/07/threading-in-javascript-17/
It is just what GHCJS needs for threading support (at least in Firefox).

Here is what I did to get it working in GHCJS...
* Added "Jump" so that tail calls don't grow the stack
* Implemented a really basic scheduler
* Added some thread and MVar primitives
* Added a YieldTrampoline calling convention to GHCJS

The code is here https://github.com/hamishmack/ghcjs

cabal install
cd examples
runhaskell BuildTestYield.hs ../../ghc-7.0.2

Then open test-yield.html in Firefox.

I think you can build it with any GHC 7 (I used 7.0.3), but you need the 7.0.2 source. I get this error when I try to use the 7.0.3 source...

../../ghc-7.0.3/libraries/base/GHC/Unicode.hs:35:0:
error: HsBaseConfig.h: No such file or directory

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply all
Reply to author
Forward
0 new messages