My thoughts on execline

With the gaining popularity of the s6-rc, I have recently decided to check out execline. It is a shell-like scripting language that is built around chaining commands together. There is no interpreter, there is no ‘built-in’ functionality even though the docs might make you think there are. Execline is best described as a suite of tools that imitate the functionality of a shell.

There are a ton of information on the execline’s page, especially discussing why skarnet prefers execline instead of /bin/sh. Those points are mostly valid, shells are a nightmare, and they suck at being compliant to the POSIX specification. What I don’t agree with the why not sh page, however, is the part on performance. Even though execline does not have an interactive shell implementation of its own, it is still much slower than other shells simply by its design. Since the design of execline is built on process chaining, it requires spawning new processes for things as basic as variable declaration. Variable manipulation is the cheapest operation you would expect from a shell, but in execline, every operation costs the same regardless of how simple it is.

Throughout my weeks of toying around with execline, I have came to the conclusion that execline is much better in simple scripts only. Execline is as usable as any shell out there, but even with its advantages over sh, execline is only better if it’s simple. Execline is really good for certain specific situations such as service scripts (as used in s6-rc), or where you were already meant to chain a couple of commands together. After all, skarnet already presents these limitations on the website of execline.

Execline can be leveraged as how s6-rc compiles service databases with other utilities, but I don’t think it can be used as a shell replacement itself. It’s not the next shiny thing to jump on to replace all your shell scripts with (unless you have really basic shell scripts). It does not have the flexibility nor the performance of the shell for scripts that can be considered a little over than the “basic”.

This page in plain-text