3 ms·
What’s wrong with python?
by Bnshsysjab 7y ago
What’s wrong with python?
- tjoff 7y agoFeels like the wrong tool for the job with the whole virtual environment that has to be brought up. Performance for shell scripts isn't super critical in my eyes but the startup time of python feels too much for something you might want to run in an inner-loop from find or something. Not sure if python IO performance is suitable for shell scripts either. Also isn't nearly as universal as shell-scripts nor something you necessarily have/want on small systems. But I will admit that I'm channeling prejudices and don't feel I have enough of a complete picture to say anything definite about it. Others in this thread touch upon it though.
- Bnshsysjab 7y agoYou don’t need a virtual env. I probably wouldn’t wrap GNU find and python, I’d just walk the directory tree in python and use regex. IO is suitable for everyday tasks and shouldn’t be an issue in Python anyway, if it is either you’re doing it wrong or your shell script should be written in C and not touch interpreted/bytecode compiled languages at all.
- tjoff 7y agoMe neither, but a big point of shell scripts is that they are the same commands you'd run on the shell itself. And there are lots of really optimized tools that are as quick as can be, throwing them out is a hefty price to pay.
- effie 7y agoIt's too high level for a shell - the unix concepts are too many keystrokes and modules away in python. Also, bad performance.