Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
irelephant [he/him] ( irelephant@lemmy.dbzer0.com )  to Programmer Humor@programming.devEnglish · 11 months ago

Some of you guys haven't used luarocks and it shows

lemmy.dbzer0.com

message-square
13
link
fedilink
169

Some of you guys haven't used luarocks and it shows

lemmy.dbzer0.com

irelephant [he/him] ( irelephant@lemmy.dbzer0.com )  to Programmer Humor@programming.devEnglish · 11 months ago
message-square
13
link
fedilink
alert-triangle
You must log in or # to comment.
  • CrackedLinuxISO ( CrackedLinuxISO@lemmy.dbzer0.com ) 
    link
    fedilink
    English
    arrow-up
    41
    ·
    11 months ago

    I once got assigned a work project to add new functionality to the web service of a recently-acquired company.

    The meat of their codebase was a single lua file to handle web requests, query value from Redis, and then progressively filter out items in a loop. Of course, because Lua has no continue statement, the file was a long series of if / else blocks. It was clear that the development style was to just keep adding new things to the loop. There were, of course, no tests.

    I asked the former CTO of the acquired company (now in a sales) why they went with Lua. His reply was something about how if Lua is good enough for fintech, it should be great for web services. He must have been good in the sales role, because when I learned how much our company paid to acquire this crappy Lua script, my jaw dropped.

    Anyway, that’s all to say that in my sample size of 1, Luarocks has been the least painful part of Lua.

    • hoppolito ( hoppolito@mander.xyz ) 
      link
      fedilink
      English
      arrow-up
      15
      ·
      edit-2
      11 months ago

      That’s a pretty crazy use of Lua if I may say so.

      It is possible to craft continue-like logic in lua, however, with (out of all things) goto statements.

      For example, I have the following code in my dotfiles:

      	for _, lang in pairs(loopvar) do
      		if condition then
      			goto continue
      		end
      		<do whatever the loop actually does>
      		::continue::
      	end
      

      Of course the continue could be called anything. Really felt uncomfortable resorting to this way but it is possible :-)

    • Droechai ( Droechai@piefed.blahaj.zone ) 
      link
      fedilink
      English
      arrow-up
      8
      ·
      11 months ago

      I did my first game in BASIC with thousands of IF/ELSE when I was like 11, good to know that experience is directly transferable!

  • Hudell ( Hudell@lemmy.dbzer0.com ) 
    link
    fedilink
    English
    arrow-up
    24
    ·
    11 months ago

    Is there even an ecosystem? I don’t think I have heard of anything for Lua itself, just the stuff that embed it.

    • FaceDeer ( FaceDeer@fedia.io ) 
      link
      fedilink
      arrow-up
      15
      ·
      11 months ago

      There is. luarocks is basically the “pip” equivalent for lua, it installs packages (called “rocks”) and manages dependencies. These packages can extend lua with all sorts of practical capabilities.

    • MonkderVierte ( MonkderVierte@lemmy.zip ) 
      link
      fedilink
      arrow-up
      5
      ·
      11 months ago

      Ruby on Rails. 🚂🚃🚋🚃

      • furry toaster ( protogen420@lemmy.blahaj.zone ) 
        link
        fedilink
        English
        arrow-up
        5
        ·
        11 months ago

        trams when?

    • irelephant [he/him] ( irelephant@lemmy.dbzer0.com ) OP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      30 days ago

      deleted by creator

  • kibiz0r ( kibiz0r@midwest.social ) 
    link
    fedilink
    English
    arrow-up
    12
    ·
    11 months ago

    My Lua experience is about 15 years old at this point, but back then I recall Luarocks had like 10 packages that were actually stable and maintained. Basically a ghost town. I’m gonna guess it hasn’t gotten much better.

    • irelephant [he/him] ( irelephant@lemmy.dbzer0.com ) OP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      30 days ago

      deleted by creator

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮  ( Kolanaki@pawb.social ) 
    link
    fedilink
    English
    arrow-up
    7
    ·
    11 months ago

    I kinda got a bad taste from LUA when I was introduced to it via it being added in GMOD. It quickly led to me quitting the game because through it, you had remote control access possibilities just by running into the wrong player.

    Like, I know that’s not common but it took a while to actually learn it after that lol

    • hoppolito ( hoppolito@mander.xyz ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      11 months ago

      Can you expand on that?

      I was running a tiny bit of garrsymod many years ago and didn’t know there were any RCEs. Unfortunately I can’t find any news reports talking about it either at a quick glance?

      • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮  ( Kolanaki@pawb.social ) 
        link
        fedilink
        English
        arrow-up
        6
        ·
        11 months ago

        When LUA scripting was first added to the game it had basically no guard rails and it was possible to write up LUA scripts that could download and execute files on your machine from within the game.

    • irelephant [he/him] ( irelephant@lemmy.dbzer0.com ) OP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      30 days ago

      deleted by creator

  • belated_frog_pants ( belated_frog_pants@beehaw.org ) 
    link
    fedilink
    arrow-up
    6
    ·
    11 months ago

    Only ever used it with WoW addons. Arrays starting with 1 is so annoying

  • entwine ( entwine@programming.dev ) 
    link
    fedilink
    arrow-up
    5
    ·
    11 months ago

    Lua is cozy, like a nice, warm dumpster fire.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 341 users / day
  • 1.49K users / week
  • 3.33K users / month
  • 7.28K users / 6 months
  • 463 local subscribers
  • 33.6K subscribers
  • 1.53K Posts
  • 25.2K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code