Hi,
I'm pretty new to Nim and just started learning how to use it. I've noticed some small things mostly revolving around the Nimble package manager that I would like to discuss with the community. I've talked with @dom96 via Twitter already about some of my ideas and he suggested creating a topic here or an issue on GitHub. I went with the former for now, and any ideas that come out of this thread can move across to GitHub later.
Nimble is a good start to a package manager and works well for now, but there are a few things that we could adopt from other languages:
I'm sure there are other enhancements and ideas too that would benefit Nimble. Having a decent, reliable, reproducible package manager and build system is key for success. I'd like to hear some feedback on the ideas presented here and some input.
I'm still starting out with Nim, but would like to get involved wherever I can, especially with anything web based which is where most of my skills lie.
@dom96:
Regarding the vendoring, Go used to have "one true version" for every package, which would be under ~/go/src/github.com/euantorano/pledge (or whatever). This was the only version you had. I assumed Nimble operated similarly, but hadn't taken the time to check - my bad! It still may be useful to have the option to vendor packages (perhaps a flag to nimble build or whatever like --vendorDir) so that you can send a full zip file including all dependencies to people that can be built easily without relying upon the package database/GitHub/the internet at all.
@dom96: The vendoring was a major issue with Go. Go has no support for version packages. It means that the package a person wrote last year and this year are from a Go point of view, the same. People add there own system of version management but its not a centralized or system in the code Go language ( mostly manual work ).
Lets say last year i wrote a program. This depends on a external library dated 2015.10.15. This year i am writing a new program and i want to use the new functionality of the same external library dated 2016.04.10. I fetch this and my new program works great. But i like to update my other program ( bug fixing, whatever ). Now i run into a problem, because the external library has been overridden with a newer version and my old program trows up a bunch of errors because of functionality changes or maybe even features that get removed or totally rewritten.
The whole vendoring is Go's "solution" for not supporting version'ing of projects from the get-go. They refused to have any version support in there modules and it bit them in the behind now. So they solved it by vendoring ( having external packages linked to a project per project base, instead of the global scope ).
Nim already supports vendoring more then Go ever did because of the way Go enforced there directory structure. I can easily have separated packages in Nim without fighting the directory structure.
This is one of the reason why i picked Nim over Go. Because the whole darn language ( while nice & popular ) is so darn restrictive, when your opinion does not match the developers, it can really lock you into dealing with annoying problems. The more the scope of a project expands, the more you run into problems like that with Go ( in my opinion ), and i hate to fight the system.
Its like dealing with PHP and the 7 year people fought the developers for having array() = [] ... That is the nice thing about Nim. Do not agree with the developers? Simply write a macro and deal with it yourself. Disadvantage: On some parts Nim is more difficult to understand the logic ( especially when you have been stuck writing PHP code for the last 10 years lol ).
Thank you both for explaining.
Based on what i've read I think I can safely conclude that this isn't a problem in Nimble. In Nimble, you can have ~/.nimble/pkgs/foo-1.0, ~/.nimble/pkgs/foo-1.2, ~/.nimble/pkgs/foo-2.0 etc. installed side-by-side. So we have versions and multiple versions of the same package can be installed at the same time :)
It still may be useful to have the option to vendor packages (perhaps a flag to nimble build or whatever like --vendorDir) so that you can send a full zip file including all dependencies to people that can be built easily without relying upon the package database/GitHub/the internet at all.
I don't think this is necessary, because you can actually do this very easily without Nimble: nim c --path:<vendorDir> file.nim.