Seems like an odd change, I wonder what the rationale is. Just making it clear to people new to the language that you can't adjust it mid-loop to change the loop count I guess?
Lua 5.5
31–40 of 138 posts
Re: Lua 5.5
#32How hard is it to put a simple hello world example on the homepage.
Re: Lua 5.5
#33Re: Lua 5.5
#34I feel like Lua is absolutely underrated. I just wish one of the mainstream browsers actually puts their foot down and starts supporting Lua as scripting language.
Re: Lua 5.5
#35> for-loop variables are read only Seems like an odd change, I wonder what the rationale is. Just making it clear to people new to the language that you can't adjust it mid-loop to change the loop count I guess?
The control variable in for loops is read only. If you need to change it, declare a local variable with the same name in the loop body.
Also [0]:
Roberto Ierusalimschy
> So what's the rationale to make them constant now? Does it have performance
> reasons?Yes. The old code does an implicit "local x = x" for all loops, in case you modify 'x'. With the new semantics, the code only does it when you ask for it.
Re: Lua 5.5
#36> for-loop variables are read only Seems like an odd change, I wonder what the rationale is. Just making it clear to people new to the language that you can't adjust it mid-loop to change the loop count I guess?
I haven't run into this myself, but it does make sense, and eliminating this footgun sounds like a good idea.
Re: Lua 5.5
#37I feel like Lua is absolutely underrated. I just wish one of the mainstream browsers actually puts their foot down and starts supporting Lua as scripting language.
This sounds like an offhand Youtube comment, I'm afraid. Underrated how? Its principal strength, easy embedding with the ability to work as an extension language, is well known in the circles where it matters. The authors never gave an impression that they'd aim to make it a language to bury all other scripting languages, which I find refreshing in the winner-take-all culture of programming language discussion. Lua is modest and works well for what it is. No need to go all grandiose.
> I just wish one of the mainstream browsers actually puts their foot down and starts supporting Lua as scripting language.
I sincerely hope not, that would be a very counterproductive dilution of effort. Browser authors already have their plate full with all other web platform problems.
Re: Lua 5.5
#38Excellent new release, now for Fennel and Love2d to update, fun times!
I don’t really follow LuaJIT too closely so I’m not sure if they’re even targeting Lua 5.4 let alone 5.5. I remember reading some GitHub issue that suggested some of the design decisions in Lua 5.4 wouldn’t really support LuaJIT goals re: performance.
With that said I’ve been enjoying Love2d even with Lua 5.1 features — as a hobbyist it works just fine for me.
Would certainly appreciate any corrections by those more in-the-know though!
Re: Lua 5.5
#39That's huge. I wish LuaJIT adopted this, or at least added a compile time flag to enable it.
Re: Lua 5.5
#40How hard is it to put a simple hello world example on the homepage.
Because Lua's Hello World is just `print("hello, world")`, which looks a lot like Python and doesn't tell you much about actually using the language.