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

Tell that to the Zsh community. Or the community for any embedded scripting language -- Emacs Lisp, Vimscript, etc.

Zsh, especially with 'set -eu', is a perfectly suitable, albeit slow, replacement for Perl, which is in my opinion more distasteful.




Another example: Arch Linux is an entire distribution developed (at least 90%) in shell scripts. For example, the installer [1] is three shell scripts of 300-400 lines each. Packages are built with `makepkg`, which is a 2400-line shell script.

It helps that the Arch developers are good at writing clean shell scripts.

[1] In the package "arch-install-scripts".


Yes, Alpine's APKBUILD seems to be very much modelled after PKGBUILD, and "abuild" sounds analogous to "makepkg". It's also 100% shell, but it uses busybox ash rather than bash.

I prefer pure hand-written shell to an unholy mix of auto-generated shell and Make. The latter is what I remember Debian's build system to be, although admittedly I haven't looked at it in awhile.


Alpine's apk-build was also written in Shell, but rewritten in C: https://github.com/alpinelinux/apk-tools

I wonder what the reason was.


There is "abuild" to build packages, and "apk" for users to install packages. abuild is definitely still in shell (~2600 lines).

I'm not sure if apk used to be in shell, but I wouldn't be surprised if it were. If you have a link to the old version I'm interested.

I think the main reason not to use shell for the user side is the version solver. To install packages, you have to solve dependency constraints, which is actually an NP-complete problem! Those heuristics are best coded in C.

In contrast, the build side doesn't have to do anything like that, or it can just shell out to "apk" if it does.


Usually rewrites to C are for performance and portability. In this case I suspect the former.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: