[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Yet another request for information and tips about making Lua syntax JavaScript like.
- From: Axel Kittenberger <axkibe@...>
- Date: Tue, 27 Dec 2011 22:33:47 +0100
> If I were to create a variant of Lua where most of the differences were syntactic, I would use something along the lines of MoonScript [1] - instead of modifying the Lua compiler to compile your language, write a translator that translates your language into standard Lua, then just load it into Lua directly. This means (a) you don't have to muck about in the Lua core, and (b) you get full interoperability with the existing body of standard Lua code.
If Lua would support annotating out of the box so each line/token
could be mapped to another file for debugging purposes this would very
ease making DSLs that produce Lua code. Otherwise changing the parser
has the advantage that you show & debug the real sources instead of
some hybrid where all the line numbers and error messages are screwed
up.