I recognize that this is just for fun, but can't help linking this anyway:<p><a href="http://www.freelists.org/post/luajit/Turning-Lua-into-C-was-alleviate-the-load-of-the-GC" rel="nofollow">http://www.freelists.org/post/luajit/Turning-Lua-into-C-was-...</a>
Would using a macro system such as <a href="http://metalua.luaforge.net/metalua-manual.html" rel="nofollow">http://metalua.luaforge.net/metalua-manual.html</a> be another way of doing this ?<p>This blog post reminded me of Lua's rather non-conformist older cousin Tcl. Shaping your own control structure is an idiomatic thing to do in Tcl thanks (or perhaps, but no thanks) to uplevel and upvar. I wish there was a standard goto (no pun intended) place exclusively reserved for creative hacks using those two. There probably is such a page on Tclers wiki, if not it very well deserves to be there.
> A return statement is only valid at the end of a block, which means if the control flow introduces new blocks, they may not behave as such without if true return end wrapping.<p>do return end