9 ms·
shell is the only portable language. It works on all Linuces, BSDs, and even on WSL. Anyone with a tiny bit of sysadmin experience knows sh. Python is far too
by moviuro 7y ago
shell is the only portable language. It works on all Linuces, BSDs, and even on WSL. Anyone with a tiny bit of sysadmin experience knows sh.
Python is far too much overhead for something as simple as firing shell (!!) commands and dumping new files in a tar archive.
And also, shell is extensible in the most simple way: you just write a program name, and boom, it runs.
Shell is simple, stable (remember the debacle of Python 2->3?), safe (no pointers, etc.), readable (compiling can even introduce issues), and dangerous only if you do it seriously wrong[0].
The only remark I have regarding code quality is that the word splitting warning is disabled for the entirety of kiss: I would have disabled it on a per-occurence basis.
[0] https://github.com/valvesoftware/steam-for-linux/issues/3671 https://github.com/valvesoftware/steam-for-linux/issues/3671
PS: the most secure open-source OS out there has a package manager written in perl, with priv-sep (https://github.com/openbsd/src/tree/master/usr.sbin/pkg_add https://github.com/openbsd/src/tree/master/usr.sbin/pkg_add).
- LinuxBender 7y agoI agree with this. I would just add that you can get great linting / syntax checking with ShellCheck [1] [2] [1] - https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck [2] - https://www.shellcheck.net/ https://www.shellcheck.net/ ShellCheck is in many of the distro package repositories already.
- dyanaraps 7y ago> The only remark I have regarding code quality is that the word splitting warning is disabled for the entirety of kiss: I would have disabled it on a per-occurence basis. There are 8 occurrences of word splitting in the source, each and every one is intentional. I also enable all lint errors when working on the package manager itself (to catch any unintentional word splitting which may slip through my fingers). The ideal goal is to reduce the word splitting count to zero though! :) (I'll go ahead and make the change you're suggesting until I do remove all word splitting).
- deleted 7y ago[deleted]