• AlolanYoda@mander.xyz
    link
    fedilink
    arrow-up
    54
    arrow-down
    1
    ·
    7 months ago

    Oh, I’m sure someone is going to hate me for this, but I really liked Lua when I was making simple games in Love2D. I think it’s a shame how there’s basically no applications for Lua outside of game development and modding.

    • KeriKitty (They(/It))@pawb.social
      link
      fedilink
      English
      arrow-up
      30
      ·
      7 months ago

      I don’t hate you, I just hate your one-indexed table-shaped horror language ;P

      But actually would anyone really hate someone for liking Lua? I hope not. That’s weird, even as someone who finds the language kinda obnoxious. Maybe I’m reading too much into the “hate” part and it wasn’t meant so severely 😅

    • Lung@lemmy.world
      link
      fedilink
      arrow-up
      23
      ·
      7 months ago

      Well configuring NeoVim is basically game development / modding. But yeah it’s built as an embedded mostly single thread thing so. I also used it for AwesomeWM many years ago, whole thing was lua. I do think it’s one of the most elegant languages ever designed, with it’s very simple table/metatable mechanics

    • spartanatreyu@programming.dev
      link
      fedilink
      arrow-up
      14
      ·
      7 months ago

      Presenting: an excerpt from my lua windows management script:

      -- Exists because lua doesn't have a round function. WAT?!
      function round(num)
      	return math.floor(num + 0.5)
      end
      

      Yeah, not a fan.

      • suy@programming.dev
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        7 months ago

        Related: There is an article on LWN called Lua and Python, which is mostly about the approach of the two languages WRT being “batteries included” or not.

        I think Lua being a bit barebones is 100% fine… if you just pair it with a good helper library, or set of libraries with a coherent API, that allows it to thrive. Then you can either use the framework library or not, depending on whether your project requires the extras, or can do without.

        As a parallel, I’ve been doing C++ development for almost two decades, and I cannot imagine doing anything non-trivial without Qt. For example, Qt has a debug framework that pretty prints automatically most containers, and adds the newline also automatically. Also, QString is an actual string type, whereas std::string is more like QByteArray. It’s functionality that it’s essential for me (and it’s just the minimal examples… then Qt has all the GUI functionality, of course, but I use Qt even in console-only programs!).

        This is surely opinionated on my side, and most C++ devs don’t see it this way, but my point is that a language with a “core experience” that it’s lackluster to you should not be a bad thing if the language is capable enough to provide an ecosystem with a good 3rd party library that adds exactly what you want. In the Lua ecosystem that maybe it’s Penlight.

        But I totally get your point. Penlight doesn’t even seem to have a math library, so I found no round implementation there. This can be not a problem for some, but deal breaking for others.

        • TehPers@beehaw.org
          link
          fedilink
          English
          arrow-up
          5
          ·
          7 months ago

          I’ve been writing Lua off and on for probably close to a decade, and I can’t remember the lack of a round function being an issue. I may have needed it at some point, but it’s not exactly a complicated function to write up in a minute.

          To me, the biggest appeal of Lua is actually the lack of an overbearing standard library. It has just enough to be usable as a scripting language within a larger application, and the larger application can always include its own helper library that gets loaded into the interpreter automatically on initialization. Feature-wise, there is enough to define your own OOP helpers (but no language built-in specific OOP stuff beyond metatables basically), there is enough to build your own async/await and generators using coroutines, etc.

          Not having a huge built-in standard lib comes with the benefit of not needing to distribute a huge standard lib with your larger application.

    • Kimusan@feddit.dk
      link
      fedilink
      arrow-up
      9
      ·
      7 months ago

      Lua is used as built-in language in more and more apps. I use it on a daily basis for configuring and extending neovim

    • redempt@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      7 months ago

      lua is a really cute and surprisingly capable language! it’s how I got my start, and it’s one of the easiest languages I’ve ever played with. it would’ve been a good pick for web, I think. probably just needed to be fleshed out more.

    • lseif@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      dont forget scripting/configuring! i love lua despite its feature we dont mention