3 ms·
Does someone use Lua for system scripting? Replacing bash and perl script on the server looks like a good fit. If so, can you share your experience?
by frik 13y ago
Does someone use Lua for system scripting? Replacing bash and perl script on the server looks like a good fit. If so, can you share your experience?
- omaranto 13y agoYou'd need some libraries before that was comfortable. At the very least you would want to install LFS (Lua File System), for things like checking if files exists and what permissions they have. If Lua string patterns don't cut it for your text munging needs, you would want another library, either a regex library, or, even better LPeg. Even with those things, things like running several commands connected by pipes is not going to be as convenient as in sh or even Perl.
- justincormack 13y agoYeah have been working on it see https://github.com/justincormack/ljsyscall/ https://github.com/justincormack/ljsyscall/
- chalst 13y agoIt's used for some configuration/ scripting in NetBSD, after Marc Balmer pushed the idea a few years back. Some links: - The Lunatik GSoC project - http://netbsd-soc.sourceforge.net/projects/luakern http://netbsd-soc.sourceforge.net/projects/luakern - Marc Balmer's FOSDEM'13 paper - http://www.netbsd.org/~mbalmer/lua/lua_config.pdf http://www.netbsd.org/~mbalmer/lua/lua_config.pdf I gather that the principal virtues of Lua for this purpose are: 1. Lua tables have a nice syntax 2. Lua's load function is very fast 3. Lua has a small, well-tested trusted code base 4. It has a sane semantics for dynamic loading