-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documenting differences between rtx and asdf #1565
Comments
I think this is great. A good opportunity to standardize tools and explain differences to users that won't be nearly as familiar as people like us are. It reminds me of https://github.com/shadowspawn/node-version-usage which is a similar useful overview. Another comparison it reminds me of is this one for chezmoi. A couple of random notes/thoughts:
|
Gotchia - I'll make those changes. Yeah I myself like both approaches so hopefully labeling them as two good options will help other people make more informed decisions. I'm thinking of listing all options in the
Yeah I want to measure performance right. I'm probably going to start with code that is ran on
I like that idea - execing into Bash for some standout output feels messy and was kind of surprised when I learned rtx did that. Once there is an rtx-specific/internal plugin system I'd be happy to contribute plugins. |
Where can I read about differences between shim and hook? I remember in the past when neither rtx or asdf-vm existed, rbenv was created because rvm was messing with the system and creating bugs. One of the biggest arguments of rbenv was
I'm surprised jdx says that (below) while clearly taking position for hook in its README (above).
So as a user that is not nearly as familiar as people like you are, where can I read about the fundamental differences between SHIM and HOOk (and auxiliary about asdf-vm vs rtx)? As a user, I want to choose based on objective criteria and not because one tool is newer, more hyper or has more "stars" than the other. |
I don't think I've seen an authoritative, objective resource for this but I can offer some thoughts after having built rtx and dealing with problems with each. Perhaps I should write this up as a more formal blog post but you can at least have some extemporaneous thoughts. To start, the main difference between hooks and shims is that shims execute the version manager every time the tool (e.g.: Where I've come down on this is that in general, I think the hook model works better in interactive setups, and shims work better in non-interactive setups. However this may be in part to the type of hook that rtx uses—some tools hook "cd" but rtx is hooked to prompt display (so effectively it can't work at all in a non-interactive setup since the prompt is never displayed). I think hooking cd is a mistake though for one big reason: it won't run if a config file is edited. For example, if I do this in an interactive session it wouldn't work if only hooking
Related to that, I actually don't know how it would be possible to ever get that in a non-interactive setup to work with any hook. Shims are the only way I can think of to handle this kind of scenario. Another notable use-case is IDEs. With hooks, you'd have to write an extension for a version manager to use it in every IDE you want to support, but with shims you just need to add a directory to PATH. So it seems shims have a lot of benefits, they are generally more "compatible" I would say, but I think the "feel" of working with hooks are better which is why I prefer it in an interactive environment. I think this is important enough to warrant having separate approaches for interactive and non-interactive sessions. If you prefer things to be consistent and don't care about the things I outline below you may prefer shims. In an interactive environment, I like I also hate that shims will be in use globally. For example, if I setup node to run in one project, then I will need to have There is a performance consideration as well that generally is in favor of hooks over shims but not always. The version manager needs to execute whenever the hook is run or whenever the shim is called. Are you running That said, the way rtx implements hooks does have some notable quirks that make some potential setups difficult if not impossible such as jdx/mise#863 where rtx is a bit aggressive with PATH modifications. You won't be able to override rtx if you're not using shims. Though that might also just be a place where I need to be more thoughtful about the design. In practice this doesn't seem to have been too big of an issue save for python where everything is pretty challenging. Anyhow, it's all fairly complex and it's not easy to say which is better or worse, but I think in general for nearly all users you'll find the experience of hooks for interactive and shims for non-interactive to behave optimally. |
Thanks for the detailed answer. |
Thanks so much @jdx for the very detailed answer! I've been struggling a bit to integrate rtx in ansible, and the following part maid it really clear even if it's not what I was looking for here! 🌹
Do you have a sample playbook that would let's say install python/pip and then run pip runs ? I have a few ideas to achieve this, but none are really convincing:
What would be your approach for this? More related to the comparaison project: It would be nice to add in the general comparaison grid two things: |
sorry for the delay, I don't know too much about using it inside of ansible but I do know that @laluka is doing that in this project: https://github.com/laluka/lalubuntu. You might be able to find out from there. |
@jdx hard morning ? 🤣 You literraly suggested me to help myself by having a look at my project.. 😆 |
Wow, lol! I didn't even look at who wrote that |
Excellent explanation in #1565 (comment) @jdx ! I'd love that to be a blog post of yours, or something we could cite in a more official manner. |
I've actually been coming back to this to reference myself in other discussions! I think I should! |
Echoing that #1565 (comment) finally helped me grasp implications of shims vs hooks for mise. @jdx Would have loved to see it included in the jtx/mise repo README or the docs website somewhere! |
Came back to this one, once again, every time I re-read it it tastes different yet still amazed by the various approaches & hook types! |
I thought it would be useful to document the differences between asdf and other meta version managers (that's what I'm it) like rtx and others that seem to be cropping up recently.
I know this repository is probably not the best place to put it, so I created version-manager/documents to put this information. For now, it includes tables for
.tool-versions
compatability and a general comparison across meta version managers. Later, I plan to include scripts to reproduciably measure performance (In the future, I will be making asdf faster so I want to chart improvements). It may also be cool to list languages that each tool supports.So if anyone (especially maintainers) have any feedback or suggestions or what you would like to see, that would be greatly appreciated! I also opened a similar issue on the rtx repository (jdx/mise#588), for maybe making it easier to talk about stuff.
The text was updated successfully, but these errors were encountered: