logoalt Hacker News

pzmarzlytoday at 8:33 AM3 repliesview on HN

This is the way. Shell makes for a terrible scripting language, that I start regretting choosing usually around the time I have to introduce the first `if` into my "simple" scripts, or have to do some more complex string manipulation.

At least nowadays LLMs can rewrite Bash to JS/Python/Ruby pretty quickly.


Replies

kh_hktoday at 8:50 AM

Well, at least I will be able to run my bash scripts in 5 years

show 3 replies
frizlabtoday at 8:37 AM

I use swift! I even (re-)wrote swift-sh[0] to make it possible to import external modules in a script (à la uv).

[0] https://github.com/xcode-actions/swift-sh

sureglymoptoday at 9:54 AM

Agreed. The shell is great for chaining together atomic operations on plaintext. That is to say, it is great for one liners doing that. The main reason probably isn't how it all operates on plain text but how easy it makes it to start processes, do process substitution, redirections, etc.

As soon as you have state accumulating somewhere, branching or loops it becomes chaotic too quickly.