
Adding Comefrom to LuaJIT - mr_tyzic
http://www.tedunangst.com/flak/post/adding-comefrom-to-luajit
======
jwmerrill
I recognize that this is just for fun, but can't help linking this anyway:

[http://www.freelists.org/post/luajit/Turning-Lua-into-C-
was-...](http://www.freelists.org/post/luajit/Turning-Lua-into-C-was-
alleviate-the-load-of-the-GC)

------
felixgallo
I'm disappointed that he didn't implement the infinitely more useful "PLEASE
COMEFROM (LABEL) STEP (INTEGER)"

------
srean
Would using a macro system such as [http://metalua.luaforge.net/metalua-
manual.html](http://metalua.luaforge.net/metalua-manual.html) be another way
of doing this ?

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.

~~~
vardump
I don't think metalua is compatible with LuaJIT. Or has this changed?

~~~
srean
You are correct it emits Lua bytecode and not LuaJIT bytecode. Wasn't there a
refactoring of metalua in progress to facilitate porting ? It would be tedious
work but there should not be any fundamental blockers.

------
Dylan16807
> 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.

do return end

------
sbahra
Is there a "Cotton Eye Joe" reference here?

~~~
tmm
Nope, it's from INTERCAL[1], which is (obviously) an abbreviation for Compiler
Language With No Pronounceable Acronym.

[1]
[https://en.wikipedia.org/wiki/INTERCAL](https://en.wikipedia.org/wiki/INTERCAL)

