[HN Gopher] What's New in Lua 5.4 ___________________________________________________________________ What's New in Lua 5.4 Author : benhoyt Score : 29 points Date : 2020-07-15 20:39 UTC (2 hours ago) (HTM) web link (lwn.net) (TXT) w3m dump (lwn.net) | Analemma_ wrote: | I've heard that a major use case for Lua is to enable scripting | in game engines - for something like that, it sounds perfect, | because the entire runtime is just a couple thousand lines of C | with few dependencies, that can be literally copy-pasted into | your codebase if need be. | | But honestly, I can't recommend Lua for any other use case. | You'll be chugging along and then run into a brick wall when you | need e.g. real regexes instead of Lua's comparatively crippled | pattern matching, or a networking library that isn't hosted on | one professor's personal web page that hasn't been updated in | years. Take it from someone who had to throw out and port a bunch | of Lua scripts when they just couldn't keep up with new business | requirements: Python or Perl or Ruby is almost always a better | choice. | blibble wrote: | I used to quite like Lua, but got quite consistently wound by up | several things - global variables by defauilt | - weird choice of certain operators (~= for not equal) - | arrays start at 1 | | (fixed yet?) | ebg13 wrote: | ~= and 1-indexing are only weird if you haven't seen them | before. MATLAB uses them as well. | jontro wrote: | The tilde ~ char is pretty annoying to type on swedish | keyboards at least. Alt + " and a space on my mac. Having to | type this regularly on my main languages would be off putting | deathanatos wrote: | It's not just weird, or different, though; there are reasons | to prefer 0-based indexing: https://www.cs.utexas.edu/users/E | WD/transcriptions/EWD08xx/E... | sk0g wrote: | Isn't "weird == not seen it before" anyway? I get what you're | trying to say, but MATLAB is not really a programming | language SWEs would use, so if that's the best example you | can think of, Lua's bound to confuse most people in the | industry. | | May work better for mathematicians, non-SW engineers etc, but | I wouldn't know. | rpdillon wrote: | Julia is 1-indexed as well. | ebg13 wrote: | > _I get what you 're trying to say, but MATLAB is not | really a programming language SWEs would use_ | | It may not be a language that website jockeys use, but "I | don't use it therefore probably no one does" is almost | never correct. MATLAB is huge in state machine and dynamic | systems programming as well as being the original | commercial powerhouse for linear algebra algorithms. | rjeli wrote: | Very nice, congrats to the Liz team :) | | The new `const` and RAII/resource scope language features remind | me of the golang discussion yesterday, someone linked Pike saying | JS/TS, C++, Hack, etc keep borrowing features from each other. Of | course we won't fully converge on some perfect syntax any time | soon, or ever, but we seem to be settling into a general | consensus on syntax in general, and semantics of dynamic | languages. | gautamcgoel wrote: | Lua is a language I really want to love. I like the emphasis on | simplicity and minimalism, and the Scheme-like semantics, which | mix imperative and functional styles, really hits a sweet spot | IMO. LuaJIT is a crazy impressive feat of software engineering. | However, there are some specific issues which hold Lua back IMO. | First, as LuaJIT author Mike Pall famously noted, the Lua authors | constantly break compatibility between releases. Lua is really | several different, incompatible languages (Lua 5.1, 5.2, etc). | LuaJIT is still at Lua 5.1, IIRC. Second, there are a bunch of | minor nitpicks (1-based-indexing, anyone?) which turn off a bunch | of people. Lastly, because Lua is so minimal and focused on | portability, people end up reimplementing their own abstractions | (such as object systems) from scratch, further fracturing the | ecosystem. I think there's a space for a new project, which takes | LuaJIT as a starting point and addresses some of the issues I | described. It would also be great if this hypothetical new | language had better support for Unicode and concurrency. | ebg13 wrote: | > _LuaJIT is still at Lua 5.1, IIRC_ | | It's 5.1 plus some of 5.2. ___________________________________________________________________ (page generated 2020-07-15 23:00 UTC)