Re: Any LuaJIT "continue" patch?

  • From: Some Guy <someguynamedpie@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 14 Apr 2017 16:01:50 -0500

I personally think it'd do LuaJIT a lot of good to start diverging from Lua
a little bit to improve the language as a whole. It has so much potential
but a lot of it is unmet because of the desire to maintain compatibility.
At this point, though, Lua 5.3 is out with things like bitwise operators
and LuaJIT is slowly aging when it comes to syntactical sugar. Things like
continue would be great if they were integrated into the language and given
FFI exists, it seems silly to use the pretense of compatibility anymore. As
long as there are no substantial API changes, everything should work as it
always has been but the quality of life improvements that would come with
things like this are insurmountably large and would do great good in
boosting LuaJIT's popularty.

On Fri, Apr 14, 2017 at 2:50 AM, Glenn Maynard <glenn@xxxxxxxx> wrote:

In case anyone else wants it, a first pass implementation of this is here:

https://github.com/zewt/LuaJIT/commit/c0e38bacba15d0259c3b77843b8e1f
a6e5312726


On Thu, Apr 13, 2017 at 5:17 PM, Glenn Maynard <glenn@xxxxxxxx> wrote:

You can use goto in place of all flow control, but this isn't BASIC.
Goto isn't a substitute for continue.



On Thu, Apr 13, 2017 at 8:07 AM, Lennart Bernhardt <l.bernhardt@xxxxxxx>
wrote:

You can just use a goto like so:

for i=1,10 do
  if i % 2 == 0 then goto continue end
  print(i)
  ::continue::end


On Thu, Apr 13, 2017 at 6:07 AM, Glenn Maynard <glenn@xxxxxxxx> wrote:

I'm testing out converting a Lua project to LuaJIT, and dealing with a
few langauge patches we use that need to be reimplemented.

One adds continue (http://www.corsix.org/luacontinue/continue.patch),
which is indispensable.  Is there any similar patch for LuaJIT?  I'm
guessing this can be done entirely within the parser without touching
codegen.

--
Glenn Maynard





--
Glenn Maynard




--
Glenn Maynard


Other related posts: