I am trying to install ghcjs hello world. Now I follow the path to standalone ghcjs and found that this has a problem with any cabal packages that has a custom build in dependency. Since the hello world example has webkit dependence and other unix package dependence, it is not compiled successfully in my case. I guess the installation of ghcjs integrated with ghc is how to make the example work, but I think many people including myself prefer to have ghcjs as a stand-alone ghcjs. Could you make some more simple hello-world example without any webkit and complex dependency? I would like to thank you again for your awesome job!

I am using Arch Linux (updated in early Sep)
I just don't get how it work. When it compiles to javascript, how does webkit part work? (runWebGUI and other functions defined in webkit library.) I thought that webkit package just wraps FFI to corresponding c function call in libwebkitgtk. How does this work with javascript? Would you elaborate what's the magic here?

When compiled to JS all those DOM FFI calls will be calls to JS functions. They are implemented here

runWebGUI is a bit special. It is defined in the ghcjs-dom package. This package does the GHCJS specific stuff

If runWebGUI is run in a browser it will pick up the current browser using currentWindow (C implementation returns 0, JS implementation returns "window"). If not it spins up a browser window using WebKitGtk.

I got it. Thanks! I imagined that you made a magical transformation of c function ffi to javascript ffi ;-)
Your hidden game is cool!!!
by the way, what's the main obstacle in implementing generic javascript FFI in ghcjs now?

Blackh deserves the credit for the game. Once it works in Firefox I think we will try to post a description of how it was done to r/programming.

The guys working on the old yhc JavaScript back end hacked something up with HDirect to process WC3 IDL files. I got it working with the WebKit IDL files and changed it to output Gtk2Hs style .chs files and once that worked I added code to generate the rts_webkit.js file. Source code is here...

This demo was built with finalizers disabled because of a bug that was causing stdout to get finalized too soon. I think I might have fixed this when I changed the entry point from Main.main to ZCMain.main (so we can print exceptions thrown by main), but I won't have time to test it till next weekend.