What am I missing about `psc-package` and package-sets that makes it usable in practice?

#1

context: I’m here after running into problems trying to use the purescript-spec package which recently updated from v3.2.0 to v4.0.0 (and only hours ago from v4.0.0-rc1, a version string psc-package can’t parse but downloaded anyway. I’m not sure if this is one of the problems that I’m running into or not.).

By design, there’s no way to specify a specific version of a package because the whole point is that there’s only one version of a package in a package set. If I write my code against v4.0 of a given package from the ‘default’ package set – or any other package set maintained by someone else – sooner or later my code will break when the package set maintainers update to v5.0. Even if they verify that v5.0 plays nicely with every other package in the set, they can’t guarantee that it will work with code outside of the set.

(I think?) The prescribed way to keep this from happening is to maintain my own package set specifically tailored for each project, in a separate repository. Instead of having a project with a dependency list of packages with specified versions, I have two projects, one of which has a dependency list of packages with specified versions, and one which has a dependency list of packages with unspecified versions.

It’s okay if the answer is “package sets aren’t helpful in your use case”, I’m just not seeing how they’re helpful for anyone’s use case – but clearly it must be, because otherwise no one would have gone to the effort of creating and maintaining the tool.

#2

Have you seen Spago? https://github.com/spacchetti/spago It provides a more complete UX on top of package-sets than psc-package (which was more of a MVP).

2 Likes
#3

Yeah, Spago uses Dhall as the package definition language, which has ways of easily extending the group-maintained package set to allow you to add packages or modify the version of specific packages. It’s a really amazingly cool ability.

2 Likes
#4

I had seen it, but I hadn’t looked into it because I was trying to avoid learning new (configuration) languages until I had written useful code in this one first.

Having looked at it now, though, I see that Spago puts the package set-list into your project folder, where it will be safe from modification, and provides commands to update/maintain it safely. That seems much more useful. I’ll give it a shot!

1 Like