lua-users home
lua-l archive

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


>Most people looking for the best performance use luac to precompile
>their scripts anyway.

Keep in mind that precompiling only buys you faster loading, not faster
execution because Lua chunks are always compiled into bytecodes before
being executed by the Lua VM.

>You could even ship luac with your
>application if you need optimal performance from user created scripts.

No need for including luac if you include the string library: you can use
string.dump for that. See test/luac.lua. Or you can use lua_dump directly.

>Still it should be made easy to optionally link in an enhanced optimizer
>with the lua core.

I had in mind an adhoc peephole optimizer, not a transparent replacement
for lcode.c, which would be harder to maintain, I think. But you're right,
it can be done with a separate lcode.c for luac, one that could be used
in the core if needed.

> But I don't think its a good reason to not add these optimizations to luac.
>First not everyone using Lua is that experienced of a programmer...
>especially for the game developers out there.

Point taken.

> The sad thing is I avoid long comments because I forget the syntax when I
>need it.  The editor I use has an option to auto-comment out stuff with --
>and I use that instead.

When we discussed long comments, some people said they didn't need them
because their editors could do it easily. If it works for you, that's fine.
But the syntax comes from a marriage between long strings and comments:
	--[[ ... ]]
The idiom
	--[[
		...
	--]]
makes it easy to turn it off and on by simply adding or removing a '-'
in the first line. I think there's a page on the wiki that discusses this.
--lhf