mardi 30 décembre 2014

npm style OS package manager. Packages local to a directory


Is there any distro or package manager with the following npm-like characteristics?:




  • Packages are installed to their own directory, chosen by the user at install time. As opposed to packages spilling their stuff all over different directories (/bin /usr/bin /etc/ ...)




  • Dependencies are contained in the local environment of a package. Clearly this is strongly coupled with the resolution of resources at runtime, which in unix is given by $PATH and conventions. In node dependencies are contained in nested subdirectories under $PKGDIR/node_module/$DEPPKG. This is only sustainable because the packages are very small, but there is a feature to link packages to other places in the filesystem. This could be the default.




What attracts me most about npm's system is that everything is local, so it is easy to reason about in isolation. There is no implicit global environment to worry about. You get user level installations and multiple versions of the same package for free. It is interesting (and in my opinion a pitty) how the idea of encapsulation has clearly impacted programming practices, but not the environments in which applications will ultimately be run.


I realize this goes against half of what unix is currently: The FSH, $PATH and other enviroment variables as a way of setting the environment, etc. However, I would argue that it is closest to the Unix filosophy, in the sense that (in my opinion) it is simpler.


Note: I'm closer to the noob side in the noob->beard spectrum. This is based more on more speculation than experience. If you think the whole idea is stupid, or you see some fundamental problem with it, please tell me why. Thanks.


Edit: Sorry to broaden an already broad question, ignore this if you like: I know little about compilation, shared libraries, etc. Is this only possible for npm because javascript is interpreted? Are there any issues with compiled languages (C, most importantly) that would make this impossible or very hard?



Aucun commentaire:

Enregistrer un commentaire