5 ms·
It is clever to use Rust so the tool won't break with each new Python release.
by hgatrd 3y ago
It is clever to use Rust so the tool won't break with each new Python release.
- sverhagen 3y agoIsn't it also declaring complete bankruptcy as far as Python's own ecosystem is concerned, that you'd have to go to Rust to fix this?
- tsunagatta 3y agoMaybe if a tool like this is successful enough it could “bootstrap” the Python ecosystem into being as reliable :P
- rtpg 3y agonot really? It's not like CPython is written in Python either. Almost every language that has some notion of virtual environments writes a good chunk as shell scripts for maximum environment compatibility. Sometimes you want to use the right tool for the job, and sometimes the scripting language that has a lot of environment-based configuration will not be a good fit for an "installer" that needs to handle a lot of environments cleanly.
- sverhagen 3y agoI don't think that's right. Sure, the language runtime environment often uses a lower level language to speak with the underlying hardware or abstraction. But large parts of standard libraries may be written in the language itself. Build systems may have a little bit of shell scripting to get going, but larger such programs would often be written in the language itself. This certainly is the case with NPM, Yarn (JavaScript), Maven (Java), Gradle (multiple JVM languages), Rake (Ruby).
- rtpg 3y agoI think Ruby's equivalent would be something like rbenv (which is just a big shell script!). Java similiarly ends up often being installed through package managers or other bespoke system installers that would at the very least need to bundle a runtime. To your point, One could write something like rye in Python, and then use PyOxidizer to package it up. I imagine a part of this is "Rust is fun", which is totally a legitimate reason to work it. And of course Rust comes with a very good distribution story (Go might have been another good answer for some people).
- snowe2010 3y agoA good example for all of these is actually asdf. Which hilariously handles _every_ language just fine, _except for _ Python and Node. It is a terrible reflection on the state of tooling in these communities.
- bin_bash 3y agoHow does asdf not handle Python and node well?
- snowe2010 3y agoFor python it routinely has trouble with pip, default locations that pip use, virtual envs break, reshimming doesn't work half the time, I can't even remember all the other issues I've had. For node it's more of the same, old versions of node were so broken that installing them through asdf doesn't work unless you build directly from source. Reshimming doesn't work half the time, global packages can't be found, idk what else. tons. It's just ridiculous to see when _every_ other language works fine in asdf.
- bsaul 3y agoAnd to add to your point: if even rust is preferable to python to write those kind of script-like tools, what does it says about the future of python ? (Yes, i know, ML, etc)
- HelloNurse 3y agoNot quite, as noted in other comments compiling the tool to a self-contained and unchangeable executable is a very effective way to avoid bootstrapping issues where to set up a Python environment (to do something useful) you need to setup a Python environment first (to run Python tools).
- isitmadeofglass 3y ago[dead]
- coldtea 3y agoIt's not like regular tools need to break with each new Python realease. It's mostly endless tinkering, attention deficit, and bad choices. Heck, even within the same Python release, I never understood why we need to be in the 2000+ update of pip, for example, and it needs to update itself almost every month or so. It's a ducking dependency installer, just formalize the design and protocols already and keep it at that. (For context, I never had that issue with npm. Not to any same-order-of-magnitude comparable level at least).
- nmalx 3y agoPython/pip criticism is downvoted again. The Python propaganda arm is strong as ever. No other language relies on marketing and censorship that heavily.
- Ingaz 3y agoI encountered problems with dependencies in python projects only when AI/ML libraries were used pytorch/scikit-learn/etc NPM on the other hand: it broke in every project and in trivial cases. E.g. upgrade of postgresql lib. I hope that deno/smth other will make possible to forget npm finally
- HelloNurse 3y agoIt's more the fault of broken libraries (remember that you depend on the weakest link out of hundreds or thousands of random strangers) than of inadequate tools.