Elektrine lite

← Feed

@novafunc@discuss.tchncs.de

2026-10-25 18:28 UTC

And generally should be more efficient too. Bash and this unix-style tool calling was not designed for efficiency. Which is fine for most use cases, but should be avoided for tools you regular use. To be more detailed, every time you call a program using bash, your bash program has to fork into two identical processes. Then all that work of forking is wasting as one of the forks then execs to replace itself with the program you called. And that happens with each tool called. Using other programs, like Python, can more efficiently exec other programs without the same overhead of forking. And for longer running jobs, Python is much more efficient as it converts itself to bytecode, whereas bash is purely interpreted. The main downside of Python is its longer time to start. So for simpler jobs, bash can be better.

Replies (1)

  • @hendrik@palaver.p3x.de 2026-10-26 08:05

    Most computer stuff is tradeoffs anyway. I mean we’re looking at different manifestations of “efficiency” here. On the one hand we’re wasting fractions of a milliseconds here and there. On the other hand this might allow us to execute code in parallel, offer modularization. I can combine wildly different programs from different manufacturers, written in different programming languages. I can install new ones and execute them straight away without reloading my shell… But I’d argue this doesn’t even matter all that much. We’re talking tiny fractions of a second in most use-cases. The real efficiency is me sitting in front of my computer and saving 10 minutes of time because it’s easy and straightforward to make the computer do the task I want it to do. I’m not a big fan of BASH. I do use it. But mostly when it makes sense and it’s the right tool. And I keep forgetting how to do if-else-statements, when to use single or double brackets… It occasionally breaks in weird ways and you need a lot of background knowledge to write good bash scripts. Python is designed with a bit of a different use-case in mind. But it can also be used to write quick scripts to sort files, do some admin stuff and automate things. Oftentimes it’s a good and comfortable tool to use.

    Open ##5253189