3 ms·
not 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 s
by rtpg 3y ago
not 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.