Rationale for package structure

70 views
Skip to first unread message

Joel Dueck

unread,
Oct 9, 2021, 1:58:44 PM10/9/21
to Racket Users
I’ve always used the single collection format [1] in my packages.

However, I see a lot of package authors will use a multi-collection format and split the library, documentation and maybe tests out into separate collections.

What are the benefits of splitting the main library and its documentation into separate collections?

Sorawee Porncharoenwase

unread,
Oct 9, 2021, 2:58:33 PM10/9/21
to Joel Dueck, Racket Users
I think it's so that `raco pkg install mypkg-lib` won't install `racket-doc` if you use Minimal Racket?

If you don't split `mypkg` to `mypkg-lib` and `mypkg-doc`, but specify `deps` and `build-deps` correctly, `raco pkg install --binary mypkg` won't pull in `racket-doc` either. I don't know when this feature was added though. Perhaps, it could be that the package splitting convention predates the feature, and the convention persists.

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/6ea9f50e-0d4f-4800-bc17-d31979a614cfn%40googlegroups.com.

Joel Dueck

unread,
Oct 9, 2021, 3:32:23 PM10/9/21
to Racket Users
Ah I see! So is there some heuristic for when you should try to play nice with Minimal Racket? Is it, ideally, “always”? Or is it mainly if you’re likely to be using the package on a server, CI, etc?

Sam Phillips

unread,
Oct 10, 2021, 12:44:03 PM10/10/21
to Sorawee Porncharoenwase, Joel Dueck, Racket Users
The --binary flag only works for the current release with the default catalog iirc.

Cheers,
Sam

jackh...@gmail.com

unread,
Oct 14, 2021, 3:34:32 PM10/14/21
to Racket Users
I don't bother with the splitting because it's a lot of maintenance headache for little gain. My opinion is that we should take the collective effort we've poured into splitting packages and instead direct it at improving the compiler and package system to do a better job of automating this process.

Eric Griffis

unread,
Oct 14, 2021, 3:45:15 PM10/14/21
to Joel Dueck, Racket Users
It's been a while since I created a new package, but as of ~1 year ago, another advantage (or perhaps the same, from a different angle) of the multi-collection format was that it allowed third parties to add modules to the collections I defined.

Eric


--

schle...@gmail.com

unread,
Oct 19, 2021, 6:58:10 AM10/19/21
to Racket Users
But you can also define two single collection packages that use the same `(define collection "...")` within the info.rkt.
And that allows you to add modules with single collection packages.
Only tested locally but seems to work.
Reply all
Reply to author
Forward
0 new messages