In association with heise online

16 August 2011, 11:24

MoonScript shines on Lua

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

MoonScript logo The dynamic scripting language MoonScript has been released and allows Lua developers to enable a number of additional features. MoonScript is syntactically inspired by CoffeeScript, a linguistic improvement of JavaScript which compiles itself into JavaScript. In a similar fashion, MoonScript code compiles into Lua source code. MoonScript code can be pre-compiled into Lua or dynamically compiled at runtime.

Lua is a compact, lightweight, embeddable open source language which is used in embedded systems and packages like Adobe's Lightroom and World of Warcraft. MoonScript brings features to Lua such as support for object oriented programming, with classes, methods, inheritance and types. Functions can optionally be called without parentheses and support implicit returns and default arguments, while tables in MoonScript (Lua's associative arrays) can be simply iterated over with table comprehensions and slicing. More details of the language changes are included in the documentation.

MoonScript code is fully compatible with the various implementations of Lua including LuaJIT and can work with pre-existing Lua code and libraries. Vim syntax support is also available. MoonScript requires Lua 5.1 and the LPeg (parser), LuaFileSystem, alt-getopt and, optionally on Linux, linotify packages. MoonScript is available under an MIT licence and the source is available from the project's github repository.


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit