lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 15 December 2011 10:46, steve donovan <steve.j.donovan@gmail.com> wrote:
> Hi all,
>
> The modest leaf corcoran has been working on his MoonScript (which is
> a CoffieScript-like language that translates to Lua):
>
> http://moonscript.org/
>
> Since he is so modest I wrote a review of MoonScript
>
> http://steved-imaginaryreal.blogspot.com/2011/12/moonscript-lua-based-language.html

Thanks, that was a great introduction. Leaf: I for one would love to
see new releases like this announced on the mailing list.

The main unpleasant point that seems to remain is the ambiguity caused
by the combination of supporting method calls without parentheses and
unary minus:
http://moonscript.org/reference/#considerations

As the documentation states, this means `b = x-10` is converted to
`local b = x(-10)`.

One aspect of Lua which Moonscript doesn't help with is the lack of a
try/catch mechanism.

Am I right in thinking that there's no way in Moonscript to express
the following?:

local var = 100
for i=1,10 do
  local var = i*i
  print(var)
end
print(var)

> Still immature, of course; languages take time and getting good error
> messages out of LPeg grammars is a bit of an art.

When playing with lpeg grammars that's always been the part I've found
less easy (and of course the part which is easiest to just ignore).
Does anyone know of any lpeg examples which do a particularly good job
of this?

Alex