MoonScript
Browse docs
MoonScript is a dynamic whitespace based language that compiles to lua.
Support for MoonScript ships built-in to lde.
You can simply write .moon files and they will be compiled ahead of time when running, testing, or bundling.
Quickstart
- Run this and cd into it:
lde new --language moonscript ./hello-moon- Replace
src/init.moonwith:
greet = require("hello-moon.greet")
n = 40
print(greet("moon") .. " " .. tostring(n + 2))- Make
src/greet.moon:
greet = (name) -> "hello " .. name
return greet- Run it with
lde run
The output is:
hello, moon 42The file src/init.moon is the entry point. This is the same as src/init.lua for packages that use Lua.