3 ms·
I wonder if language designers will take package management into more consideration in the future. For example, what if every library's version was included in
by pg_bot 7y ago
I wonder if language designers will take package management into more consideration in the future. For example, what if every library's version was included in the module name during compilation. So you automatically go from MyLibrary.my_function() to MyLibrary::V1.0.0.my_function() after compiling the code. This way you could easily run different versions of the same library in dependencies without dealing with the headaches that normally causes. The only additional restriction I would add is that you have to use an exact version of a library instead of giving the package manager discretion.
Has anyone tried to implement something like that in a language?
- goto11 7y agoI believe .net works like that, more or less, although the libraries ("assemblies") are not statically linked. Assemblies declares a dependencies on a particular version of an assembly. It is possible to override this in a configuration file, so you "redirect" to a newer version.
- Ididntdothis 7y agoThere is a lot there but it’s pretty hard to maintain. Visual Studio has a tendency to sometimes upgrade references automatically. I have seen it now several times that a project has been set up with the correct references, then somebody else opens the project, saves, and now everything is changed. Makes me sometimes get nostalgic about make files. It took a while to build them up manually but then they were stable. With Visual Studio there is too much “intelligence” and wizardry going on behind the scenes.
- throwaway8941 7y agoIf I understand you correctly, this is what Rust/Cargo currently do. You can have multiple versions of the same library in transitive dependencies, and it will link them all into the same binary using a name mangling scheme similar to what you describe. https://stackoverflow.com/questions/51714866/ https://stackoverflow.com/questions/51714866/
- Vogtinator 7y agoOn platforms with ELF binaries that works with any language and symbol versioning already.
- aasasd 7y agoJava apparently has a solution, named ‘shaded dependency’: https://softwareengineering.stackexchange.com/questions/297276/what-is-a-shaded-java-dependency https://softwareengineering.stackexchange.com/questions/2972... The name seemingly stems from the Maven plugin: https://maven.apache.org/plugins/maven-shade-plugin/ https://maven.apache.org/plugins/maven-shade-plugin/ JS sidesteps the issue by having imported modules as local variables, and thus modules may have different versions of dependencies by simply dropping different files in the hierarchy. In theory this should also be possible in Python, but PyPI modules are usually installed as shared dependencies there.