by tcfhgj · 2y ago · 0 comments
The only thing which will just work is viewing the script. For execution, you first need to install the correct python interpreter. Probably you need to activate a environment, because the global one is incompatible. Then you need to install the dependencies, which hopefully are 100% specified and restricted to pip, otherwise you might run into hours of SAT resolving.
For a compiled language, you need to install a Compiler instead of a interpreter or even nothing if you just get the executable.
With a modern language and required dependencies, running the script in a modern compiled language is probably simpler than doing it with Python (e.g. cargo run takes care of fetching deps which python doesn't)
Cargo is great, I agree it's approaching the usability of running a Python script there. But now you're compiling Rust, which is going to take orders of magnitude longer than any time you'd save from the script itself running faster. Plus for most of the scripts Python is used for from what I can tell, more time is spent writing them than running them anyways. So as much as I do love Rust I'm not buying that it's the better choice here.
You don't know Anaconda?
> Cargo is great, I agree it's approaching the usability of running a Python script there
I think it's clear that the usability of cargo run is much higher than "prepare everything yourself, then python script.py"
> which is going to take orders of magnitude longer than any time you'd save from the script itself running faster.
In this case: no, otherwise obv. depends on the code and dependencies