←back to thread

370 points adriangrigore | 1 comments | | HN request time: 0s | source
Show context
packetlost ◴[] No.43558205[source]
I unironically wish there was an enterprise version of Plan 9. I've been writing most of my scripts in `rc` (something my coworkers put up with because we use nix and I can pull it in automatically with dirnev) and it has been great.
replies(3): >>43558552 #>>43559150 #>>43563792 #
yjftsjthsd-h ◴[] No.43558552[source]
I would worry less about other people being able to run rc scripts and more about them being able to read/edit them.
replies(1): >>43558583 #
packetlost ◴[] No.43558583[source]
they're routinely very short, and the only non-obvious syntax for someone familiar with a C-like language is the ~ command and redirecting to stderr. They're pretty much always easier to read (and write) than bash scripts in general because of how little weird/surprising syntax there is. Not being a derivative of ALGOL has its perks.

Most scripts are write-once:read-never, especially if you actually implement -h/--help

replies(1): >>43559079 #
eddythompson80 ◴[] No.43559079[source]
> Most scripts are write-once:read-never, especially if you actually implement -h/--help

I guess the answer is always “it depends”, but that generally has never been my experience with most things. Are you over-engineering the shit out of every script to the degree the script itself is a Turing complete machine and with enough —-help flags anything is possible? Most 40+ year old Unix tools with a thousand flags have their limits and you have to script around them to achieve things you want.

In my experience, eventually a business need will arise that require you to change a script. Are your coworkers comfortable changing these scripts or are you in the mind set of “that’s a simple enough change, I’ll do it”

replies(2): >>43561841 #>>43561887 #
1. packetlost ◴[] No.43561887[source]
Not work related, but here's some examples of what these scripts look like (this is how I mirror public repos locally using cron/timers): https://paste.sr.ht/~chiefnoah/3b8990fc0b8eb3f50e511d5d4051a...

Even if you aren't super familiar with rc, it's not that weird to look at. I find it way more readable than (ba)sh syntax.