print "Hello, World!"
Hello World in Moonscript was written by:
This article was written by:
If you see anything you'd like to change or update, please consider contributing.
Hello World in MoonScript has a relatively simple implementation.
All we have to do is call the built-in Moonscript function
In other cases, it could be different. For instance, we could have an implementation of some arithmetic which we print to the user:
x = 10
y = 15
z = x + y
The code is then compiled into Lua like this:
local x = 10
local y = 15
local z = x + y
How cool is that?
If your feeling adventurous today, You can quickly install MoonScript using one of the following methods:
For Windows users, you can try installing the windows binaries.
For Linux users, install LuaRocks which is a package manager for Lua modules. Then run the following command:
luarocks install moonscript
With the moon executable and Lua modules on your device, run your .moon file with this command:
Also, you can compile your .moon file into Lua by using this command:
Alternatively, you can always run MoonScript using an online compiler.