5 ms·
What’s the dev experience actually like for serious Lua? I’ve only used it for some basic neovim configuration. The dynamicism and lack of type hinting in Pytho
by smohare 1y ago
What’s the dev experience actually like for serious Lua? I’ve only used it for some basic neovim configuration. The dynamicism and lack of type hinting in Python that was the norm when I started having to review professional code, after transitioning from pure mathematics, was a major cognitive blocker for me. With a math paper I could typically skim the first few pages to map the author’s particular symbology (if non-standard) and know exactly what was being expressed. I could never do that with untyped code.
- unleaded 1y agoLua can be quite an elegant language once you get to know it well, but you can still use it like most other programming languages, it's not that weird. There are quirks like arrays starting at 1 (and all arrays being hash tables) but they don't take that long to get used to. The real strength is in the ecosystem and implementation itself, it's designed to be easily embedded into applications and there's not really much else like it. Some developers want to incorporate a scripting language into their project and get turned off by Lua's quirks and choose something else, but it usually ends up causing more problems than it was meant to solve. On typing, there's only a few main ones you need to worry about—strings, functions, tables and numbers. I don't think it does weird things like JS where it converts between them without asking. Luau adds some type hinting if it's a big point of concern but I haven't really looked into it much.
- SV_BubbleTime 1y ago> There are quirks like arrays starting at 1 I know it’s probably and overreaction, but this was a compete non-starter for me.
- Lyngbakr 1y agoWhile I understand the aversion, I can't help but think that people miss out on some really cool experiences when they balk at stuff like 1-based arrays or parens in Lisp or whatever. Sure, those quirks may remain deal breakers after you've given the language a thorough try, but you may also gain super interesting new perspectives in the process.
- docandrew 1y agoNot having to put length-1 everywhere is a good thing, actually.
- const_cast 1y agoProbably just use a .last method or something. Reads better too.
- pmarreck 1y agoThere are languages that transpile to Lua that get you things like typing… https://typescripttolua.github.io/ https://typescripttolua.github.io/ I’m personally a fan of YueScript which is basically an evolution of MoonScript (but it’s not typed). https://yuescript.org/ https://yuescript.org/ LuaJIT has ridiculously easy C interop.
- mdkdjdnffn 1y ago> What’s the dev experience actually like for serious Lua The dev experience for lua is f-ing awful. The language is small, but not “simple”; it’s stuck in 1985. The tooling is nearly non-existent and the stuff that does exist is a joke. The few libraries that exist are awful and barely maintained; the maintained libraries are maintained by neckbeards with a god-complex. The community is “reimplementing everything by hand is the right way to do it AND ALSO you’re an idiot doing it wrong” toxic. There are a million good reasons why it’s only has a foothold in nginx and Roblox territory. It’s not a joke to say that it’s f-ing terrible all the way around.
- uamgeoalsk 1y ago[flagged]
- docandrew 1y agonginx and Roblox and redis and nmap and neovim and cryengine … the list goes on There are a LOT of tools with embedded Lua scripting capabilities.
- giraffe_lady 1y ago8 years of full time professional lua development experience here and unfortunately I agree with all of this. I use fennel when I can; it doesn't improve any of the library or tooling problems but it doesn't make them worse either and addresses several of the problems with the language semantics itself.
- hajile 1y agoLua was designed in 1993. This was back when MS-DOS was still cutting edge and the 66MHz Pentium was cutting-edge consumer technology. Even "modern" languages often don't have features like first-class functions, closures, proper tail calls, etc that Lua has had for a very long time now. LuaJIT also trades blows with JS almost certainly making it the fastest or second-fastest dynamic language around. There's a lot to like about the language (aside from array indexes starting at 1), but I think you are right about the ecosystem and probably right about most of community.