leafo/moonscript

:crescent_moon: A language that compiles to Lua

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 56 minutes ago
Added to GitGenius on September 20th, 2026
Created on May 23rd, 2011
Open Issues & Pull Requests: 158 (+0)
GitHub issues: Enabled
Number of forks: 199
Total Stargazers: 3,468 (+0)
Total Subscribers: 84 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 5
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,849 days
Stale 30+ days: 5
Stale 90+ days: 4

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • planned (2)
  • bug (1)
  • syntax proposal (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

MoonScript is a language that compiles to Lua, offering a more programmer-friendly syntax while targeting the fastest scripting language runtime.

The tool addresses the verbosity and syntactic friction of writing Lua directly. MoonScript compiles to Lua code, allowing developers to write in a higher-level language while retaining access to Lua's performance and ecosystem. The compiler itself is self-hosted, written in MoonScript and compiled to both C and Lua, ensuring it can bootstrap consistently. The parser uses a parsing expression grammar defined in a separate tool and generates both a native C module for performance and a pure Lua equivalent for portability.

MoonScript suits developers already committed to Lua who want cleaner syntax without sacrificing runtime performance or compatibility. It runs on Lua 5.1 and above, including LuaJIT, making it compatible with existing Lua environments. The project provides an online compiler for experimentation and editor support across Vim, Emacs, Sublime, and Textadept. Precompiled binaries are available for Windows, and installation via LuaRocks is supported for those wanting a separate working version alongside development.

The project maintains both source and generated files in the repository to allow users to install and use MoonScript without compilation while preserving the bootstrapping process. The parser grammar is regenerated from its specification using an external tool, with both C and Lua outputs checked in. Tests are written in MoonScript itself using Busted, creating a self-referential development environment where the compiler must work to verify itself. The project hosts a community Discord and provides detailed contribution guidelines emphasizing that only source `.moon` files should be edited directly, with generated `.lua` files updated through the build process.