3 ms·
is there a TL;DR for why some people don't want namespaces for crates? Is it just because NPM does and javascript is bad or is there something else I'm missing?
by wnevets 6y ago
is there a TL;DR for why some people don't want namespaces for crates? Is it just because NPM does and javascript is bad or is there something else I'm missing? I couldn't imagine github or npm working well without them.
- steveklabnik 6y ago> Is it just because NPM does and javascript is bad Not at all! In fact, npm's implementation is why some are pro, but also why some say that it's not worth it; see https://news.ycombinator.com/item?id=24444852 https://news.ycombinator.com/item?id=24444852 for some npm specific sentiment. (Incidentally, npm added scoped packages in 2015, after these decisions were made for crates.io. However, crates.io is still smaller than npm was then...) There isn't really a TL;DR because this space is complex, and there's a lot of details, and they matter, and different people have different reasons for not wanting them. I think it's good that github has namespaces, but that doesn't mean I think that Cargo should have them, because they're fundamentally different services. The short reason we gave back in 2014 was: > Because namespaces are strictly more complicated in a number of ways,and because they can be added compatibly in the future should they become necessary, we’re going to stick with a single shared namespace. from https://internals.rust-lang.org/t/crates-io-package-policies/1041 https://internals.rust-lang.org/t/crates-io-package-policies... which is linked in the post.
- mmis1000 6y agoBut unlike traditional namespace, that you automatically got alias to things inside the same namespace. The npm's namespace is basically just a preserved prefix, mention scoped package inside another scoped package still requires you to write full name (scope + package) or it didn't work. I don't really see a reason that you can't implement it in a flat name package manager? Something like "you can't publish a package named as 'USERNAME_private_WHATEVER' unless you are USERNAME"
- steveklabnik 6y agoNobody is saying that it's impossible to implement. However, someone would have to write that up as a plan, including all the details, and put it through the RFC process, and get folks to agree that that plan is the one that should be implemented, rather than other possible plans.
- deleted 6y ago[deleted]
- hobofan 6y agoThe article is more or less already the TL;DR. My perception is that there isn't a strong aversion to adding namespaces, it's just that 1. the crates.io team is understaffed (unlike NPM it's not a VC funded entity), and it has not been a priority for them (or for anyone deeply involved in Rust/Cargo/crates.io development, AFAIK) 2. there are some core design decisions around the feature for which no consensus has been reached yet
- pjmlp 6y agoMaven also does it.