Hacker News new | past | comments | ask | show | jobs | submit login

I love this!

The only part I find questionable is the use of tools written in shell. Shell is a very difficult language to understand and use correctly. To the credit of the author, he is aware of this and the code is linted using shellcheck. Still, I wonder if it wouldn't have been a better idea to write the utilities using Python or Lua or even (gasp) C! (Or Rust, or Go or ... Just pick one that isn't completely esoteric and isn't Perl, then stick to it.)




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

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).


> 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).


I 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

[2] - https://www.shellcheck.net/

ShellCheck is in many of the distro package repositories already.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: