使用 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!