Source code repository is available on Github, all code under MIT license.

Presentation for Fosdem 2013 is here: A high level language for low level code

Linux distributions are very complex today, contain a lot of code, and are difficult to manage. A whole infrastructure has been set up around managing this code. First there were package managers, and now we have tools like Puppet to manage the total state, and try to get it to where it should be. Trying to deploy all this infrastructure in an environment with lightweight virtualization, containers, or small low power servers gets really complex.

In addition, the whole model goes against the kind of continuous deployment model we work with for applications. Here we try to have repeatable builds and deploy the application as a whole. Why can't we do that with the whole system? The dependencies have just got too complex, and the build times too long.

Along with this idea came a few more. While systemd is an attempt to remove shell scripts from the Linux init system, and replace them with faster, simpler, more reliable C code with configuration files, why do we need C code for this? Why not have a simple scripting language that can initialize the system. That makes the code easy to read and write, and it is a lot easier to write the code, while being much more powerful than shell scripts.

Then the LuaJIT ffi came along, and this seemed the perfect tool as it gives native C performance in a scripting langauge, and binding to C code is really easy. So the ljsyscall library started, initially just to get the basic system call interface ready. This is also useful as a general programming library for Lua for networking and other applications. Work has continued adding more Linux ABI interfaces, in particular so far netlink support, which is unfinished but now covers the basics of configuring network interfaces and is progressing faster.

Lua is a perfect configuration language, so works very well for this type of application. Fairly soon there should be a basic system that can boot up and configure a basic server machine. There will be lots missing but it should be a decent thing to start experimenting with, though not suitable for production. At that point we will also put together a build system, which will be based around the small, fast and lightweight Musl libc, which should mean we can make a small system with a footprint of a few megabytes that builds in a few minutes. All userspace code will be BSD licensed.

All of this is of course highly experimental, and may well be a ridiculous plan, so feel free to heckle.

Justin Cormack, 25 July 2012

Here is another post about ljsyscall by William A Adams.