lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Apr 16, 2016 at 9:09 PM, Steve Litt <slitt@troubleshooters.com> wrote:
Hi all,

After introduction of the systemd init system, a lot of people are
creating their own init systems. One guy did it in Ruby.

I'm thinking that Lua is much smaller than Ruby, and in my opinion it's
more understandable, and from what I read, it's faster. The reason it
would be good to be static is so that an initramfs wouldn't be
necessary (though it usually is for other reasons). But static
compilation isn't absolutely necessary: all the libraries could go in
an initramfs.

The version of Lua for this thing would need to have signal handling,
forking, and exec'ing. Are those features in place with standard Lua?

Is 5.3 available pretty much everywhere these days? If not, which Lua
is the most widely available?

Thanks,

SteveT

Steve Litt
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21


My thoughts:

* Lua as an init system sounds fantastic. In fact a *lot* of the various scripts and config files around a Linux system could be replaced with Lua scripts.
* BSD did some work on Lua in the kernel. Look into that.
* Stock Lua doesn't have signal handling, and that's something that's very difficult to implement correctly, but very easy to implement in a way that *seems* correct until it blows up in your face. Tread carefully.
* It doesn't provide fork or exec either, but those are simple enough. You're going to need to add some C functions anyway.
* I don't see any reason you couldn't use 5.3. However I think there are more libraries available for 5.1. Whether you'd want to use them in this context, I can't say.

--
Sent from my Game Boy.