4 ms·
Adding Comefrom to LuaJIT
- sbahra 11y agoIs there a "Cotton Eye Joe" reference here?
- tmm 11y agoNope, 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
- srean 11y agoWould 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 11y agoI don't think metalua is compatible with LuaJIT. Or has this changed?
- srean 11y agoYou 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.
- felixgallo 11y agoI'm disappointed that he didn't implement the infinitely more useful "PLEASE COMEFROM (LABEL) STEP (INTEGER)"
- jwmerrill 11y agoI 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-alleviate-the-load-of-the-GC http://www.freelists.org/post/luajit/Turning-Lua-into-C-was-...
- Dylan16807 11y ago> 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