Why don't we use domain stuff for library name on Pursuit?

This is a good time to raise the issue, as we are currently discussing plans for a PureScript registry over at the https://github.com/purescript/registry repo!

I think npm-style scoped packages is probably not a bad idea. I think it would be nice to be able to easily identify core libraries if they were called e.g. @core/arrays or something. I think I prefer that to domains, especially since it’s not clear what you should do if you want to publish a package but you don’t own a domain yourself. I guess com.github.hdgarrood.whatever works, but that does sort of undermine the idea that the owner of the domain owns the package namespace. Imagine if GitHub itself wanted to publish PureScript packages, for instance. (Maybe that’s wishful thinking on my part, haha).

The main issue I see is that of module name collisions. Right now there is nothing other than convention linking module names with package names, i.e. it’s expected that a package purescript-bleepbloop would contain a module Bleepbloop. If I publish @hdgarrood/bleepbloop with a module Bleepbloop and you also publish @matoruru/bleepbloop with the same module name, any project which depends on both of these will simply not work. I’m sure this will become an issue eventually in any case, but right now, I think the lack of scoped packages does help us stave it off for a bit longer.

I really think that imported module names in source code should match package names in the registry, which is why I created https://github.com/purescript/purescript/issues/2437. I think we would need to find a way of doing this for scoped packages to be workable.

7 Likes