wanpeebaw
2020-5-23 08:51:57

Since Racket is a language promotes immutable state and data structure. Would it be nice to also have an immutable package system?

I propose a potential way of doing that. When a package is posting to the packages manage system. The system don’t overwrite the package but append a newer version of the package with a timestamp. Fetching package with a timestamp will only fetch the newest version before that timestamp.


laurent.orseau
2020-5-23 08:53:08

I think the current system is merely shadowing the previous package, and garbage collection gets rid of the previous version :wink:


wanpeebaw
2020-5-23 09:05:10

@laurent.orseau The garbage collection gets ride of the previous version while there are still references to it. The consequence is a mutable package system which breaks contracts all the time. :wink:


laurent.orseau
2020-5-23 09:08:50

As a temporary fix, you can at least probably checkout a particular commit from github (if from there). Is this about one of your packages or someone else’s?


popa.bogdanp
2020-5-23 11:04:50

@wanpeebaw sounds like you’re describing https://racksnaps.defn.io/


samth
2020-5-23 15:09:16

First, I want to suggest that proposals at the slack level of detail for major changes to the package system are not going to make a big difference


samth
2020-5-23 15:10:25

Second, one of the big challenges for many package system changes is that we don’t host the content of the packages, and don’t want to. So immutable package systems would have to address that somehow


laurent.orseau
2020-5-23 16:43:26

It looks to me like the above is really just high level discussion and is by no means near a proposal, so Slack seems fine to me as a medium here. But feel free to tell us where to move the discussion to if you feel there’s a better way.

Otherwise, I (strangely) don’t have strong opinions here, but one thing that seems possible to me is for the package manager to collect the commit hashes of each git(hub) package at each new minor/major Racket version. Then raco could do something git --clone <pkg> && git --checkout <commit> . This would be very much like snapshots without hosting the packages themselves.

Another possibility is to greatly help the user generate versions of their packages and standardize the process. For example, one could imagine a raco command like raco github freeze [major] that would automatically generate the next minor (major) version git tag with a standardized numbering following Racket’s, and maybe even communicate with the pkgs server to generate a new package automatically.

Again, I’m not pushing for anything here, just thinking aloud.


sorawee
2020-5-23 20:05:52

I believe pkg server supports more than the git protocol, so the approach that deeply ties to git would be undesirable


laurent.orseau
2020-5-23 20:26:23

Fair point, although offering better tools for the majority doesn’t mean letting down the rest—you can still do as before. Now I’m wondering what proportion of the packages on pkgs are non-git.


samth
2020-5-23 20:32:25

One important case is all the packages in “main-distribution” for all the releases are zip files.


laurent.orseau
2020-5-23 20:33:12

Good point, although i would have excluded these from this tool.


laurent.orseau
2020-5-23 20:33:52

Also imagine someone non-core develops such a useful tool (initially for his/her own purpose) that can be used by others without explicit support from pkgs, but works only for github. Would this be a bad thing?


wanpeebaw
2020-5-24 02:50:40

> supports more than the git protocol Wouldn’t keep the original source reference and a timestamp work for most protocols?