Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
RFC: depend on the PureScript compiler #98
Following up from this Discourse thread, a big problem seems to be that when we have breaking changes in the compiler there are "ecosystem splits", and picking the right packages is hard (especially with bower) if the people just does
Spago is currently not immune to this problem: we're wrapping whatever compiler the user has installed, so if we have a post-0.12 package set, it's not gonna work if the user has purs-0.11 installed. In general, the "compiler version the package-set is compatible with" is not checked against "compiler version currently installed", and this is not right! (as it's easy to diverge)
As usual, the "Stack solution" for this is really good:
The downside of this is that the tooling (read: editor integrations) will have to talk to spago instead of the compiler for things like
In our case we would not download a version of the compiler, but we could:
Why go to the extent of including the compiler itself? One solution to this problem could be to just specify which version of the compiler with which a package set is compatible and verify that the correct compiler version is being used when building the project.
In short, I don't fully understand the tradeoffs here. What gains does one get through this approach and at what costs?
@JordanMartinez good questions.
In the end, my main goal here is the following:
Now, shortly after writing down this issue I realized that baking the compiler into Spago is not a good idea. Because this means tying the Spago version to a Purs version, and this implies some uncomfortable things like:
So, what we should really do is to make package-sets aware of the compiler version they should be run in. This happens already with purescript/package-sets, where the minimum compiler version is stated in the release name itself. I think this would be a good solution for Spacchetti.
Then, we should check that we're running at least that compiler version in
This would be already enough to have decent assurance and prevent you from running broken packages.
Now, the Stack approach goes even further, as Stack will download the right compiler version for you. It'd be nice, but it would imply some amount of work that we can skip for now.
That sounds like a good long-term feature to implement eventually since it's not quite a pain point that needs to be addressed in this current context.