Exactly 3 months ago I released MoonScript. The CoffeeScript inspired language that compiles to Lua. Since then I've both written a lot of MoonScript and enhanced the MoonScript compiler.
Today I'm proud to release v0.2.0. I've got a handful of new features and bug fixes:
Thanks for checking it out, follow me on twitter for updates or complaints.
, is used instead of : for delimiting table slice parts.__base. __base is
also used in inheritance when chaining metatables.switch statement.self in this scope refers to the class itself.__name property.super keyword in instance methods.object\function_name as
a value. Called function stubs.export * statement to export all assigned names following the
statement.export ^ statement to export all assigning names that begin with a
capital letter following the statement.export can be used before any assignment or class declaration to export
just that assignment (or class declaration).:hello is short hand for hello: hello inside of table literal...= for string concatenation.table.insert no longer used to build accumlated values in comprehensions.loadfile, loadstring, and dofile functions to moonscript module
to load/run MoonScript code.to_lua function to moonscript module to convert a MoonScript code
string to Lua string.inotify is not
available.I'm now including a small set of useful functions in a single module called
moon:
require "moon"
Documentation is available here.
... within comprehensions when the compiled code
uses an intermediate function in the output.@ in function definitions work outside of
classes work with default values.with block.Since the first release, I've written one other project in MoonScript (other than the compiler). It’s a static site generator called sitegen. It’s what I now use to generate all of my project pages and this blog.
leafo.net · Generated Tue Dec 16 16:18:13 2025 by Sitegen mastodon.social/@leafo