1,380 karma · joined Mar 19, 2020 (6y ago) · 457 submissions
comment 2y ago · link · parent
comment 2y ago · link · parent
At that point it would make sense for them to also make scaffolding generators, meaning the cli author only has to write one spec and don’t have to repeat the effort for their code so much.
comment 2y ago · link · parent
It gets way too complicated real quick and a lot of things you _dont_ want to expose in documentation. It’s better to generate docs from a spec than the other way around, I’m pretty sure of this now.
comment 2y ago · link · parent
I am working on it here: https://github.com/jdx/usage
It's mostly just a README right now, and I'm still iterating on it, talking to friends, but I think I'm getting close. It's definitely not yet written for the average developer to consume yet either. My hope is within the next month or two I might have a usable alpha release of it. I have a use-case for it now so I think it’s finally ready to happen.
If you have any thoughts on my design lmk.
comment 3y ago · link · parent
EDIT: just tested on the eslint codebase:
cold (nothing installed, no cache): bun: 1.53s, pnpm: 8.25s, npm: 25s
hot (already installed, noop): bun: 218ms, pnpm: 1300ms, npm: 1230ms
comment 3y ago · link · parent
I've swapped much of my usage of npm over to bun. I still work on projects where nobody else is using bun, but I can run `bun install` instead of `npm install` and `bun run` instead of `npm run` and these run probably 100x faster.
comment 3y ago · link · parent
Generally speaking you'll probably want to use `rtx activate` in your shell rc. However you could use the shims instead if you just wanted to add a directory to PATH instead.
Of course you'd be getting rid of one of the major selling points of rtx by using shims, but it's so much faster than asdf the shims aren't as bad as they are in asdf.
comment 3y ago · link · parent
I wrote an alternative that has 0 overhead called rtx. https://github.com/jdxcode/rtx
comment 3y ago · link · parent
comment 3y ago · link · parent
This, like shims, would require “reshimming” anytime a new binary is added by pip/npm. I really want to avoid that as I see juniors (and sometimes experienced devs) get in a bad state fairly often forgetting (or not understanding) reshimming.
I’m also not sure how you deal with subprocesses calling binaries. If they’re only shell functions they only exist to the shell.
> save the extra exec
rtx is already over 100x faster than asdf so this wouldn’t be necessary really. I could load test and optimize for setups with a ton of plugins and stuff if needed. My reason for avoiding shims is entirely UX related, not performance. Though I do think asdf would not have its problems if it didn’t use shims. This really is just because asdf is in bash and rtx is in rust. (I think rtx is already a lot more LOC though, and not as clean).
But in regards to PATH, I think I can get rtx to not screw up anything else that would be modifying PATH (slightly different algo than what’s currently used right now). I can’t guarantee that nothing will screw up rtx, but I can prevent direnv in particular from doing it.
It may be a game of whack-a-mole testing with different tools that modify PATH to get them to not conflict. That’s fine, it’s such a better solution.
I also think if rtx is loaded after other hooks it shouldn’t get messed with. It’s only if it gets called since potentially those tools could remove rtx paths and there isn’t much I could do about that.
comment 3y ago · link · parent
That said, I was thinking about this yesterday and that it’s currently painful to have to type out each plugin one by one. I added this ticket for making `plugins install` default to installing all plugins in the local tool-versions: https://github.com/jdxcode/rtx/issues/50
What do you think? Is that discoverable and useful enough? I could go a step further and add a `--plugins` argument to install or something.
comment 3y ago · link · parent
This was with a half dozen plugins and use_legacy_file disabled. Hardly an edge-case. Though I'll note in other tests it was around 200ms (which is the number I put in the README to be fair). @danfritz in this thread said his can take over 2 seconds!
Out of curiosity, what is the difference between `time node -v` and `time ~/.asdf/installs/nodejs/*/bin/node -v`? I've never seen it not add at least 100ms.