I can understand not wanting to use Python for everything, but I see the problem being the 'use it for everything' not the language choice.
Use the tool that excels at the job. There is no language that is good at everything.
I can understand not wanting to use Python for everything, but I see the problem being the 'use it for everything' not the language choice.
Use the tool that excels at the job. There is no language that is good at everything.
https://news.ycombinator.com/item?id=22712441
And updated it six months later:
https://news.ycombinator.com/item?id=24595081
That's still how I'd do this task today.
Anyway, I don't think that Rust is always a great choice for scripting, but if you already know Rust, it's totally fine at it.
Not at all, I do the same.
Some that come to my mind: its versatility binding native code and its easy-to-fit in your brain mental model for many tasks. The fact that you can script with Python without a compilation step also helped a lot to spread its popularity I think.
I'm indifferent when it comes to Python vs Rust for scripting, but I'd take Rust over a shell script (of any variety) any day.
It's also totally impractical. Rust isn't the only language I haven't tried; there are more than a thousand of them. I'm not using JOVIAL for scripting, or Fortran, or a bunch of others. No, I haven't tried any of those either. No, I'm not going to.
Turning specifically to Rust, I don't use it for scripting because it's not what I look for in a scripting language. It's compiled; I look for a language that doesn't have that extra step. It has the borrow checker; I don't write scripting code that needs that level of discipline and care.
In fact, most of my scripting is of the form "pick some bits out of a text file". For that, Perl is my tool of choice. Sure, other languages have regexes. None of them do it as cleanly and simply as Perl. (Note well: "clean" does not apply to the Perl syntax...)