Today marks MoonScript version 0.2.3, the CoffeeScript inspired language that compiles to Lua. It's been about 3 months since last release. I've got a couple new features, fixes, Lua 5.2 support and a backwards incompatible change.
You can follow me on twitter for updates or complaints. Also if you're using MoonScript I'd love to hear about it: leafot@gmail.com.
You can find the full release notes on my blog: http://leafo.net/posts/moonscript_v023.html
Changes
- For loops when used as expressions will no longer discard nil values when accumulating into an array table. This is a backwards incompatible change. Instead you should use the
continue
keyword to filter out iterations you don't want to keep. Read more here. - The
moonscript
module no longer sets a global value formoonscript
and instead returns it. You should update your code:
moonscript = require "moonscript"
New Things
- Lua 5.2 Support. The compiler can now run in either Lua 5.2 and 5.1
- A switch
when
clause can take multiple values, comma separated. - Added destructuring assignment.
- Added
local *
(andlocal ^
) for hoisting variable declarations in the current scope - List comprehensions and line decorators now support numeric loop syntax
Bug Fixes
- Numbers that start with a dot, like
.03
, are correctly parsed - Fixed typo in
fold
library function - Fix declaration hoisting inside of class body, works the same as
local *
now
Other Stuff
MoonScript has made its way into GitHub. .moon
files should start to be recognized in the near future.
Web
I've started a couple interesting projects for MoonScript as a web programming language.
- Lapis -- A MoonScript friendly web framework. Includes application routing, a HTML construction MoonScript DSL, and a basic ORM.
cloud_storage
-- A MoonScript/Lua module for interacting with Google Cloud Storage.
Using the following I've created a community powered Lua rock hosting website called MoonRocks:
http://rocks.moonscript.org. (source)
Compiled MoonScript runs inside of the nginx distribution OpenResty. I created a created a Lua rock for running OpenResty on Heroku in conjunction with my Heroku Lua buildpack.
Games
Ludum Dare happened again, two games were created in
MoonScript:
- X-Moon
- Event Horizon -- by SelectricSimian
Additionally, Michael F has created a game engine, BoxEngine, which natively supports MoonScript.
Thanks
Thanks to everyone who provided feedback for this release. See you next time.