MoonScript is a dynamic scripting language that compiles into Lua, combining the power of one of the fastest scripting languages with a rich set of features found in Lua.
MoonScript was created by someone who goes by the pseudonym of Leafo, although his real name might be Kyle Klegg or Jason Moon, who is associated with MoonScript on at least one GitHub repository.
The primary goal of MoonScript is to make writing code faster and more enjoyable, achieving this through an intuitive syntax and simplified features, allowing developers to focus on solving problems without strict rule sets. It was first released in September of 2015 and is available under the MIT License.
MoonScript was influenced by CoffeeScript, with which it shares similarities, although some of its features, such as table comprehensions and implicit returns, were inspired by Python.
MoonScript can be compiled into Lua and run later, or dynamically compiled and executed using its moonloader, a function that searches for a valid MoonScript file. MoonScript is compatible with LuaJIT and existing Lua code and libraries. MoonScript can also be run from the command line like any first-class scripting language.
MoonScript's features include a clean syntax, table comprehensions, implicit return, classes and inheritance, scope management, and object creation.
MoonScript uses significant whitespace, avoiding the keyword noise typically seen in a Lua script. Table comprehensions provide for concise list creation, and its functions automatically return the last evaluated expression. MoonScript supports classes and inheritance, import and export statements help manage scope, and the with statement simplifies object creation in MoonScript.
The project's source code is available on GitHub, and MoonScript can be installed using LuaRocks. Precompiled Windows binaries are available for easy installation.
Supporters of MoonScript hold that it provides an elegant and efficient way to write Lua code, making development more enjoyable for programmers.
This part of our computer programming language guide focuses on MoonScript.
 
 
Recommended Resources
The chief creator of MoonScript provides a concise introduction to the language, which compiles to Lua and is inspired by CoffeeScript. Beginning and more advanced programmers who are new to MoonScript may benefit from this accessible overview of the language's syntax without requiring prior experience in MoonScript or in Lua, to which it compiles. Included is an overview of the language, its syntax, functions, Boolean values, and comparison operators.
https://leafo.net/posts/moonscript_overview.html
Getting Started with MoonScript
Provided by the chief designer of MoonScript, an open-source programming language that compiles into Lua, this instructional describes the purpose of the language and its relationship with Lua, as well as its installation through Windows, OSX, and Linux, and getting started in programming via MoonScript. Included is information on setting up the editor, creating programs, compiling them, and running them. Screenshots are included, along with a list of other projects.
https://leafo.net/posts/getting_started_with_moonscript.html
Created by Seth Moeckel, GMoonScript is a MoonScript compiler for the Gopher Lua Virtual Machine (VM). Available under the MIT License, this module is said to be experimental, providing methods for compiling MoonScript code to Lua from Go or Lua (Gopher-Lua) programs. Additionally, the GitHub repository contains an amalgamation bundle of the MoonScript Lua library, modified to use only pure Lua modules, that can be used in Lua or MuaJIT programs without external dependencies.
https://github.com/cosmotek/gmoonscript
GitHub hosts repositories for various software projects, including programming languages like MoonScript. The official GitHub repository for MoonScript offers access to its source code, binaries, documentation, and related utilities, allowing the MoonScript development community to collaborate on the project, including access to an online demo/compiler for MoonScript and resources for those interested in joining the MoonScript community. Issues and pull requests may be made through the site.
https://github.com/leafo/moonscript
This is the GitHub repository for Moonscriptxx, a standalone executable compiler for the MoonScript scripting language, which compiles MoonScript into binary executables to distribute to large groups of machines, increasing security, performance, and compatibility. Available via the MIT License, the utility is useful for distributing software to large groups of machines. Documentation and licensure data are set forth, and links to a Wiki provide additional information.
https://github.com/owenkimbrell/Moonscriptxx
This is the official website for MoonScript, a dynamic scripting language that compiles into Lua. Because it compiles right into Lua code, it is completely compatible with alternative Lua implementations, such as LuaJIT, and is also compatible with all existing Lua code and libraries. An overview of the language, installation instructions, links to its source code (available under the MIT License), and learning resources are provided on the site, along with extras and add-ons.
https://moonscript.org/