GHCJS
Introduction#
GHCJS is a Haskell to JavaScript compiler that uses the GHC API.
Running “Hello World!” with Node.js
ghcjs
can be invoked with the same command line arguments as ghc
. The generated programs can be run directly from
the shell with Node.js and SpiderMonkey jsshell.
for example:
$ ghcjs -o helloWorld helloWorld.hs
$ node helloWorld.jsexe/all.js
Hello world!