Hacker News new | past | comments | ask | show | jobs | submit login

No language has this down, but there's an environment manager (pip, rustup, rbenv..) that try to do all, and avoid the need to handle more than one "magic" session in your bashrc(etc): "asdf":

https://github.com/asdf-vm/asdf

Now, a few new languages do come with pretty decent "virtual env" thingy-s , but most stumble for a few years.

So far (past year) I've been pretty happy with asdf. Mostly use it for ruby and node - but also rust and golang, lisp, Java and ocaml (mostly as a "consumer" of various cli tools, and/or toy projects.




Another way to do this is to install Nix and direnv (and/or Emacs direnv-mode), then include a `use nix` statement in the .envrc file inside your project root.

Then, when you `cd` into your project directory, your environment with all its dependencies appears.

However, there are some downsides to this magical future tech:

+ Nix is hard to learn.

+ Not compatible with the standard environment managers for each language.

https://github.com/direnv/direnv https://nixos.org/nix/


Interesting. I've been considering nix, but wasn't aware of direnv. Should be a sensible combination.


asdf is fine for small cli tools, but it fails way too often when you need something that requires more configs and system level integration, so then you end up installing nvm, rvm etc anyway.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: