使用 Node.js 執行 Hello World
可以使用與 ghc
相同的命令列引數呼叫 ghcjs
。生成的程式可以使用 Node.js 和 SpiderMonkey jsshell 直接從 shell 執行。例如:
$ ghcjs -o helloWorld helloWorld.hs
$ node helloWorld.jsexe/all.js
Hello world!
可以使用與 ghc
相同的命令列引數呼叫 ghcjs
。生成的程式可以使用 Node.js 和 SpiderMonkey jsshell 直接從 shell 執行。例如:
$ ghcjs -o helloWorld helloWorld.hs
$ node helloWorld.jsexe/all.js
Hello world!