r/lua • u/kayinfire • Nov 01 '25
Does anyone else use lua as their main language for system automation and shell scripting?
it's no secret that Lua is heavily underrated. ironically, i used to be against lua until i understood how nifty it is as a language. i formerly thought that one had to use index or metatable to create objects, only to find out that i could do this
```
function NameOfObject(instanceVariable1, instanceVariable2)
return{
method1 = function(self)
end,
method2 = function(self)
end,
method3 = function(self)
end,
}
end
```
and just like that it overtook the appreciation i had for how objects can be created in other languages.
in a less subjective sense, however, given how ridiculuously fast lua is compared to the bulk of languages that are interpreted, i committed to it for all my scripting needs.
lua has now become my premier choice for automating anything related to my environment: my file system, my window manager, and even my system settings. it also greatly helps that i can automate repetitive and tedious text editing in neovim with lua as well.
i formerly used python for my scripting needs, and in retrospect, it's rather comical to me how poor python is as a scripting language compared to lua; it's a night and day difference. i can always trust lua for a startup time that is as good as instantaneous, whereas such a thing would be a fool's game in python.
granted, python does have all the abstractions one can hope for, but for system tasks, it's just outright overkill. one does not need a gazillian abstractions for system admin or shell scripting needs
anyways, i've rambled long enough. is there anyone else that uses lua for shell scripting needs and system automation, as opposed to roblox, C programming, game dev, and other low level tasks?
View all comments
Show parent comment
2
u/kayinfire Nov 01 '25
i love that for you. glad someone out there has had effectively the same experience i've had. os.execute() is indeed my best friend as well.
i'm even more glad, however, that i was able to teach you something new!
i myself wish that approach to creating objects was promoted more. however, i also understand that one would be rendered unable to make use of inheritance. that's the one tradeoff i can think of surrounding the approach in my post, so your mileage may vary depending how you feel about inheritance, or the lack thereof.
personally, i don't really care for inheritance; i've never encountered a problem that made me feel like it couldn't be solved by simply composing small objects