# leafo/moonscript

:crescent_moon: A language that compiles to Lua

Repository: https://github.com/leafo/moonscript
Canonical: https://ross.abutalabs.com/products/moonscript
Homepage: https://moonscript.org
Language: C
License Family: other
Topics: moonscript, lua, language, transpiler, parsing-expression-grammar
Last push: 2026-08-13T23:04:09+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 63, longevity 100
- inputs: {"age_days": 5581, "days_push": 20, "days_rel": 38, "gap_med": 197, "n_releases_24m": 2}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3461, forks 199 (observed 2026-08-28T04:08:05.657455+00:00)

## What it is
MoonScript is a programmer-friendly dynamic scripting language with significant whitespace, classes, and comprehensions that compiles to Lua 5.1+ and LuaJIT. It ships as a self-hosted compiler with CLI tools, a moonloader for runtime compilation, and a native C parser generated from a pgen grammar.

## Use cases
- write Lua code with cleaner syntax
- compile a language to Lua
- use classes and inheritance in Lua
- run MoonScript files directly from the command line
- dynamically load and compile MoonScript at runtime with moonloader
- target LuaJIT with a friendlier language

## When to choose
- you want a cleaner, whitespace-significant syntax on top of Lua
- you need full compatibility with existing Lua libraries and LuaJIT
- you're building Lapis web apps or games on the Lua ecosystem

## When to avoid
- you need plain Lua output you can hand-edit and maintain
- your team only knows Lua and won't learn a new language
- you need a language with active, frequent development

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: compiler, parser, programming-language, cli
- domain: programming-languages, compilers, parsers, developer-tools
- platform: lua, cpp, windows, cli
- tags: transpiler, moonscript, lua, significant-whitespace, self-hosted, luajit-compatible, pgen, command-line, linux, macos

## Member repositories
- leafo/moonscript (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:05.657455+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:36:55.528279+00:00, confidence not recorded.
  - readme: https://github.com/leafo/moonscript (fetched 2026-08-28T04:08:05.657455+00:00, sha 7585ebaa4468)
  - homepage: https://moonscript.org (fetched 2026-08-29T09:30:56.710145+00:00, sha 3f7353f7cbf8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
