These guides each answer one practical question about writing MoonScript. For a complete description of the language, see the Language Guide. Every MoonScript example in these guides is compiled when the site is built, and the Lua shown next to it is the real output of the compiler.
-
How to Call Methods
How to call methods in MoonScript with the backslash operator, why Lua's colon syntax doesn't work, the difference between \ and ., and how @ refers to self inside a method.
-
Making Games with MoonScript and LÖVE
How to write a LÖVE (love2d) game in MoonScript: project setup, compiling with moonc, a complete example game, finding error line numbers, and packaging a .love file for itch.io.
-
How Variable Scope Works
How variables are scoped in MoonScript: assignment creates locals, assigning to an outer name reassigns it, and how to use local, export, and the linter to control scope and avoid accidental globals.