News for hackers. Stuff that matters.
Re:What's New in Lua 5.4 by anonymoushn on Thursday July 16, 2020 @12:24AM (#23855751)
A minor hobby of mine is collecting proposed changes for Lua. Let me make sure I have these right:

- some syntax like js arrow function (this is tough because {} are not block delimiters, maybe single-expression lambdas like in python? I kind of hate those though.)

- `??` operator which does the same thing as `or` except when the left operand is exactly `false`

- `?:` operator. Should this evaluate to exactly one value or any number of values? e.g. x?2,3:4,5

I recently encountered a library that addresses some of the first need: https://github.com/starwing/luaiter#the-selector-interface

Re:What's New in Lua 5.4 by mingodad on Thursday July 16, 2020 @02:58AM (#23856537)
Also there is https://github.com/mingodad/ljs that changed the parser to accept a Javascript like syntax, including https://github.com/mingodad/ljsjit for LuaJit and includes a tool to automatically convert lua to ljs https://github.com/mingodad/ljs/tree/master/lua2ljs and did several project conversions to check that it's feasible and works (see the readme).
Re:What's New in Lua 5.4 by Pxtl on Thursday July 16, 2020 @11:43AM (#23860130)
Exactly.

Theoretically I could get this stuff by using Moonscript, but then I'm using a somewhat esoteric language that brings in a lot of other very unusual ideas.

Although for ternary, I honestly think the "if/elseif/else can be used as an expression" has always been my favorite syntax. Or the CASE...WHEN syntax of SQL.

Re:What's New in Lua 5.4 by anonymoushn on Friday July 17, 2020 @01:54AM (#23867505)
Some compile-to-lua languages include if expressions, but they commonly compile to IIFEs to support evaluating to a number of values other than 1. It's troublesome. I think the bytecode can express what you want.