5 ms·
I’ve seen people use Go because it’s a simpler language. It’s what I would probably use if I didn’t want to use bash. What do you think about editing the title
by auslegung 6y ago
I’ve seen people use Go because it’s a simpler language. It’s what I would probably use if I didn’t want to use bash.
What do you think about editing the title to include “for scripting”? I thought you were asking for recommendations like zsh or fish when I first clicked
- lordgroff 6y agoGood point, changed.
- magicpointer 6y agoAlso go has the advantage of producing a single static binary. Easy to build on your machine and run on another host.
- berkes 6y agoWhich is why I'm writing most of my tooling in Rust. Deployment or installation is just one scp away. not rewriting, just when It needs large refactoring, or is currently a mess, or brand new.
- brundolf 6y agoAssuming you're deploying to the same OS/architecture that you're working from, otherwise you'd have to rebuild (which Rust makes easy to do, but still)
- Raed667 6y agoHow easy is it to cross-compile with Rust?
- brundolf 6y agoTrivial. All of the tooling, dependency management, linking, etc. is neatly bundled together under cargo. Just run "cargo build" for the current system, or specify one or more other architectures as arguments to get multiple binaries. Everything's statically-linked so you should be able to scp those wherever. Still, when we're talking about casual "scripts" even this extra step seems a little bit burdensome
- berkes 6y agoTrue. Though in all those cases, for me, all alternatives are just as bad or worse. Getting ansible running on a windows server is... unfortunate. Ensuring that your bash script runs on OSX is easier, but I've had lots of unexpected issues with tools like grep or find working just a tiny bit different. And so on.
- brundolf 6y agoNode scripts, even with dependencies, are pretty much 100% equivalent across all platforms :)