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

Hello I am matoruru.

I would like to take this topic to discuss a way to name our library and perhaps to need changing the structure.

I already tweeted for this topic yesterday (please vote!): https://twitter.com/_matoruru/status/1262767476380598272

Now we have lots of libraries on Pursuit thanks to PureScript maintainers and authors of each library. This is great. But at the same time we also have some libraries which are not well-maintained.

For example, purescript-electron, I was going to use this library few months ago but I hesitated because it was old. And I was not sure the author of the library accept my Pull Request. I suppose many other people had been feeling the same, no?

I can make purescript-electron-v2 or something like that but I don’t like it.

So this time I would also like to suggest us to use domain stuff for naming a library which is like Java package style (com.somename.libname) or Vim plugins style (githubusername/libname). I think Vim plugins style is more simple and easier because we already have that structure on GitHub…

I think it needs to change many structures so I’m hesitating to ask maintainers first for that but this time at least I just would like to ask what does the member of our community think about this.

Please feel free to comment.


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.


Thank you for replying. I’m glad to receive the first reply on my first post :slightly_smiling_face:

I agree with npm-style and it looks good. And yes that’s also better for person who doesn’t have their own. And it is not the same exactly but even if you look at the poll in my tweet above, voters prefer Vim style (it looks like the same as npm-style, separated by a slash) than Java style (it looks like domain).

Yes… I was focusing on package names and I didn’t on module name well. That can be issue as you wrote.

Now “scoped packages” sounds good. I hope we will have something for this :slightly_smiling_face:

1 Like

had the same toughts - added your proposal here The only thing I hate in purescript and haskell - imports

1 Like

I created an issue for that here: https://github.com/purescript/registry/issues/54

Maybe the registry could check for that? That way the compiler does not need to be package aware.