• [object Object]@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    12 hours ago

    I’m more familiar with Lua for desktop scripting — I’m using it whenever I can, if it’s something that’s more than like three lines in Bash and the Lua libraries aren’t too bad. I’m even using it on the phone when dragging around blocks in Automate becomes too much (its minuscule footprint comes handy there). There’s also the excellent automation app Hammerspoon for Mac, which uses Lua for its scripting.

    I’ve been vaguely looking now and then into using it for web in the manner of node.js, with asynchrony being handled on the Lua side — but was offput by the fact that many popular Luarocks libraries presumed synchronous workings, and async requires installing different libs if they even exist. Node has it better since the libs were developed to be async from the start. Iirc Luvit is what I was looking at, there are both libs and some kinda frameworks for it.

    OpenResty and frameworks for it like Lapis could be the better way to go. Nginx is pretty much mandatory anyway, and afaiu synchronous libs can be used then, leaving it to Nginx to chuck requests into multiple Lua threads. A drawback is that LuaJIT, used in Resty, still supports only Lua 5.1 features, which is pretty damn old.

    I haven’t looked into Lua for web in a few years, but since apparently nothing like Hammerspoon with its built-in http server exists for Linux, I’ll need to pick it up again, just to do some custom remote control from the phone.