3 ms·
There are large advantages to shelling out though. 1. Not reinventing the wheel 2. Implicit use of multiple cores Things could be improved I agree. For exam
by pixelbeat 11y ago
There are large advantages to shelling out though.
1. Not reinventing the wheel
2. Implicit use of multiple cores
Things could be improved I agree.
For example posix_spawn() could be efficiently implemented on glibc to avoid kernel overhead for fork()+exec() from large processes. Then language runtimes could use that
to implement their "shell out" routines.
Also pipefail doesn't cater for SIGPIPE as detailed at http://www.pixelbeat.org/programming/sigpipe_handling.html http://www.pixelbeat.org/programming/sigpipe_handling.html
which can be awkward.
- StefanKarpinski 11y agoThese are advantages of calling external programs, not of shelling out – which specifically entails using a shell as an intermediary to call an external program. All of the pitfalls in this blog post are due to using the shell, not to calling other programs. If you avoid the shell, then you avoid these issues.