News for hackers. Stuff that matters.
Re:LuaJIT 3.0 proposed syntax extensions by Ardren on Wednesday June 24, 2026 @11:41PM (#48668579)
> For compatibility with other computer languages, the following classic Lua operators can be written in a more customary syntax:

Why though? What does changing `and` to `&&` actually achieve? Were people confused?

Changing the syntax seems very surface level. It's not actually fixing any problems, just making Lua no longer look like Lua. It's not going to help anyone write/learn Lua. It will make everything more complicated as there are now two ways to do everything.

This feels like adding braces to Python because you don't like indenting your code.

Re:LuaJIT 3.0 proposed syntax extensions by nullpoint420 on Thursday June 25, 2026 @12:46AM (#48669023)
> This feels like adding braces to Python because you don't like indenting your code.

Now this I can get behind...

Re:LuaJIT 3.0 proposed syntax extensions by bonoboTP on Thursday June 25, 2026 @05:02AM (#48670868)
Re:LuaJIT 3.0 proposed syntax extensions by doophus on Thursday June 25, 2026 @01:56AM (#48669509)
> Why though? What does changing `and` to `&&` actually achieve? Were people confused?

Also consider AI, that has a greater training base of JavaScript than Lua. So making Lua look more like JS, should improve output and reduce mistakes.

Re:LuaJIT 3.0 proposed syntax extensions by lionkor on Thursday June 25, 2026 @02:53AM (#48669882)
No, don't consider AI.
Re:LuaJIT 3.0 proposed syntax extensions by boxed on Thursday June 25, 2026 @03:14AM (#48670017)
AI has greater training on Python, which uses `and` and `or`, and it has absolutely no issue keeping that straight.
Re:LuaJIT 3.0 proposed syntax extensions by boomlinde on Thursday June 25, 2026 @11:19AM (#48674719)
I can't imagine that making the differences between the languages more subtle would improve the performance of chatbots. Subtleties aren't their strong suit.
Re:LuaJIT 3.0 proposed syntax extensions by simonask on Thursday June 25, 2026 @02:56AM (#48669901)
Ruby has both kinds of operators as well, and it's fine. The thing in Ruby, though, is that the English logical operators have lower precedence than the symbolic logical operators, so you can use them in place of parentheses. Sometimes that's confusing, other times it can be used to make code very readable.

In general, I would expect symbolic operators to be desirable in complex boolean expressions, because "loud punctuation" stands out among English words when reading the code.

Re:LuaJIT 3.0 proposed syntax extensions by spider-mario on Thursday June 25, 2026 @05:34AM (#48671101)
Same in Perl, hence the good old pattern:

    open my $fh, '<', 'input.txt' or die;
Re:LuaJIT 3.0 proposed syntax extensions by codesnik on Thursday June 25, 2026 @06:45AM (#48671592)
yes, ruby inherited this from perl, though 'or' has lower precedence than 'and' in perl, and they're equal in ruby. Which sounds like something going to cause mistakes, but I yet to see 'and' and 'or' together in the same expression in ruby.
Re:LuaJIT 3.0 proposed syntax extensions by ClikeX on Thursday June 25, 2026 @07:26AM (#48671859)
I've always found it odd that and/or in Ruby isn't just considered equal to &&/||, and I have never really used the english operators except for the usual modifiers like if and unless.

What is a practical use case where the lower precedence makes sense?

Re:LuaJIT 3.0 proposed syntax extensions by aeonflux on Thursday June 25, 2026 @10:21AM (#48673851)
Those two behave in the same way if you drop the parentheses:

1. statement if (condition || something)

2. (statement if condition) or something