News for hackers. Stuff that matters.
Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by zeotroph on Sunday December 30, 2018 @02:39PM (#18790894)
Maybe also properly separated list/array, map/dict and set types? The I-am-everything-{} type in lua is a bit unergonomic when you want to use it as only such a type and a stumbling block for unfamiliar users.

Can a project using 5.3 lua continue using existing .lua files but also write new files in .ljs?

> switch

Aren't match statements all the rage nowadays? Even C++20 get's one (with a silly name, of course)!

> class

Finally, setmetatable is nice, but, yes, "proper" not handrolled classes.

> const

Too few scripting languages have these. Do you intend to make this include interior mutability as well or is this only pointer deep?

Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by mingodad on Sunday December 30, 2018 @02:56PM (#18790984)
The general idea is to be able to reuse code as much as possible, and C/C++/Java/Javascript style syntax make a lot of code available and if we ditch the 1 based index in favor of 0 based it makes it even easier.
Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by mkl on Sunday December 30, 2018 @06:57PM (#18792080)
It looks like it's still 1-based currently, is that right? 1-based arrays have been the biggest obstacle to me using Lua.
Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by spc476 on Sunday December 30, 2018 @08:46PM (#18792520)
I did years of assembly, then C, and now Lua. I've yet to find the 1-based indexing to be an issue, and that's even having written a few C modules to manipulate Lua arrays. What is it about the 1-based arrays that is so off-putting?
Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by mingodad on Monday December 31, 2018 @02:51AM (#18793569)
Again the point is easy code reuse.
Re:Show HN: Lua/LuaJIT with C/C++/Java/JavaScript syntax by mingodad on Monday December 31, 2018 @04:56AM (#18793872)
Yes you are right it's still 1 based to allow easy conversion from actual existing Lua projects.