Exactly 3 months ago I releasedMoonScript. The CoffeeScript inspiredlanguage that compiles to Lua. Since then I've both written a lot of MoonScriptand enhanced the MoonScript compiler.
Today I'm proud to release v0.2.0. I've got a handful of new features and bugfixes:
Thanks for checking it out,follow me on twitter for updates orcomplaints.
, is used instead of: for delimiting table slice parts.__base.__base isalso 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 asa value. Calledfunction stubs.export * statement to export all assigned names following thestatement.export ^ statement to export all assigning names that begin with acapital letter following the statement.export can be used before any assignment or class declaration to exportjust that assignment (or class declaration).:hello is short hand forhello: hello inside of table literal...= for string concatenation.table.insert no longer used to build accumlated values in comprehensions.loadfile,loadstring, anddofile functions tomoonscript moduleto load/run MoonScript code.to_lua function tomoonscript module to convert a MoonScript codestring to Lua string.inotify is notavailable.I'm now including a small set of useful functions in a single module calledmoon:
require"moon"Documentation isavailable here.
... within comprehensions when the compiled codeuses an intermediate function in the output.@ in function definitions work outside ofclasses work with default values.with block.Since the first release, I've written one other project in MoonScript (otherthan the compiler). It’s a static site generator calledsitegen. It’swhat I now use to generate all of my project pages and this blog.
leafo.net · Generated Sun Oct 8 13:02:35 2023 bySitegenmastodon.social/@leafo