Comment on What are the recommended scripting languages for complex shell scripts beyond bash?
gopher_protocol@programming.dev 1 year agoRust is heavily based on Ruby’s design
I would not say “heavily based”. Literally only the closure/lambda syntax, which is cosmetic. Rust is mainly inspired by ML-family languages and C++.
I think Ruby is a reasonable choice for small scripts which someone might otherwise use Python for. But Rust is very well suited to more complicated or long-lasting command-line tools, especially if performance is at all a concern. Clap alone is super nice, but there are a lot of awesome libraries for making rich CLI tools easily.
- colored or owo-colors for adding terminal colors super easily
- crossterm for cross-platform terminal feature support
- rustyline for all your fancy readline needs
- cursive for TUIs
- comfy-table for command-line tables
And like…a hundred more I could mention. Idk, for anything that’s not completely trivial, which will be used and maintained by humans and not thrown away, Rust is really nice.
snowe@programming.dev 1 year ago
All of Cargo is based on (and created by) the same person that created bundler for ruby. That list also misses out on a lot of things, like
!
, automatic returns, honestly most of the actual language ‘design’ rather than the internals (that seems to be a list of where the architects got their ideas for internal implementation as well, rather than just the readability of the language).I disagree. Like I said, I wrote command line apps in all of these, performance was a factor. But a much larger factor is getting other devs on your team to contribute. And that was just absolutely impossible with Rust. The learning curve is just too high. For something that isn’t a hobby project, but that you might need a team member to roll out a fix in just a few hours, Rust will not cut it.
Yes, you will have way more bugs in all the other programs, but honestly I had a shit ton of bugs in my rust cli as well, because, it turns out, rust works really well when it has control over everything, but man does it suffer when you have to interface with the real world… And oh boy did that make it incredibly difficult to write. Like I said, I deployed CLIs in all three of these languages. Ruby was the easiest of them all. Not just in development, but also maintenance.