20211012-execline.md (2378B)
1 My thoughts on execline 2 ================================================================================ 3 4 With the gaining popularity of the [s6-rc], I have recently decided to check out 5 [execline]. It is a shell-like scripting language that is built around chaining 6 commands together. There is no interpreter, there is no 'built-in' functionality 7 even though the docs might make you think there are. Execline is best described 8 as a suite of tools that imitate the functionality of a shell. 9 10 There are a ton of information on the execline's page, especially discussing 11 why skarnet prefers execline instead of `/bin/sh`. Those points are mostly 12 valid, shells are a nightmare, and they suck at being compliant to the POSIX 13 specification. What I don't agree with the [why not sh] page, however, is the 14 part on performance. Even though execline does not have an interactive shell 15 implementation of its own, it is still much slower than other shells simply by 16 its design. Since the design of execline is built on process chaining, it 17 requires spawning new processes for things as basic as variable declaration. 18 Variable manipulation is the cheapest operation you would expect from a shell, 19 but in execline, every operation costs the same regardless of how simple it is. 20 21 Throughout my weeks of toying around with execline, I have came to the 22 conclusion that execline is much better in simple scripts only. Execline is 23 as usable as any shell out there, but even with its advantages over `sh`, 24 execline is only better if it's simple. Execline is really good for certain 25 specific situations such as service scripts (as used in s6-rc), or where you 26 were already meant to chain a couple of commands together. After all, skarnet 27 already presents these limitations on the website of execline. 28 29 Execline can be leveraged as how s6-rc compiles service databases with other 30 utilities, but I don't think it can be used as a shell replacement itself. It's 31 not the next shiny thing to jump on to replace all your shell scripts with 32 (unless you have really basic shell scripts). It does not have the flexibility 33 nor the performance of the shell for scripts that can be considered a little 34 over than the "basic". 35 36 37 [s6-rc]: https://www.skarnet.org/software/s6-rc/ 38 [execline]: https://www.skarnet.org/software/execline/ 39 [why not sh]: http://www.skarnet.org/software/execline/dieshdiedie.html