lua-users home
lua-l archive

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

luaSub does the front end thing by creating a lua_Reader that feeds the resulting code (after tokenizing & syntax mods) to liblua, internally. It's just an extended 'lua' application, with all the normal command line flags working as usual. The downside is that there's essentially a second, unneeded tokenizing round (the usual Lua round) but it really isn't much of a speed issue, either.

I guess it all comes to how and where one wishes to use syntax mods. Personally, I think the entry step for them should be relatively low, and they should be usable commonplace, by common man. This year will certainly tell.


Mark Meijer kirjoitti 3.2.2008 kello 0:29:

On 02/02/2008, Asko Kauppi <> wrote:
As Luiz mentions with the token filter patch, it's mainly _intended_
to be used with 'luac', not liblua itself.

Having worked my head off with luaSub, I think token filters won't
even be needed in Lua core, at all. Along the lines of Luiz's
recommendation, token filtering will be an added layer more in the
realm of the syntax front end.

Good news:      no changes to Lua required
Bad news: there are multiple solutions with differing way of defining
syntax mods (this is not necessarily bad, imho)

Yeah I noticed Luiz writing that somewhere. Isn't the "syntax front
end" of luac the same realm as the "syntax front end" of the Lua,
though? Changes would be required to it, but there would then be two
variations of it (one the runtime core, and one the pre-compiler
tool). And in order to use the token-filter enabled version, one would
be required to precompile all their stuff and have the runtime invoke
the resulting bytecode.

Precompile config files created/edited by your users because you
wanted them to have a less intimidating/more intuitive syntax? I don't
really see any advantage, nor how it mitigates any of the possible
problems associated with making it officially part of Lua in the first

Maturity-wise, the original patch's main shortcoming is in not giving
syntax awareness. Both Metalua and luaSub do provide that.

If you wish to test-drive luaSub for your own particular itch, I'll
be happy to take in people for a test drive. It _is_ approaching beta.

Sounds nice. Can't guarantee when I'd have time to indulge myself with
it, though.