<div dir="ltr"><div>Here is a patch for a proof of concept (file /collects/pkg/lib.rkt).<br><br></div><div>The modifications are minimal as I had expected, but obviously I only have a very narrow view of the package system, so probably something does not work properly.<br>
</div><div>In particular, I changed only for the 'dir type, and did not touch the 'link type.<br>Since the 'github type and others use the 'dir type once the archive is downloaded, I think it should work as expected for those too.<br>
</div><div><br></div><div>I've tested on an "old" 5.3.4.10--2013-05-13(96acfb0/a) [3m], but made the patch with the latest in git, and it still works with the old version.<br></div><div>(I was about to test it with the latest nightly, but its installation failed, see the mailing list)<br>
</div><div><br></div><div>To try it, in the collects/pkg directory:<br></div><div>$ patch lib.rkt lib.rkt.patch<br></div><div>$ sudo raco setup -D pkg<br></div><div><br></div>Then create a dummy package:<br><div>$ cd /tmp<br>
</div><div>$ mkdir dummy<br></div>$ echo '#lang racket\n(displayln "It works!")' > dummy/main.rkt<br><div>
<div>$ touch dummy/single-collect<br><br></div></div><div>The file "single-collect" is here to signal that this package is a single-collection package (it's not the right way to do it, but it's a proof of concept).<br>
<br>Install the package:<br>$ raco pkg install -t dir dummy<br>
<br></div><div>(You should see "This is a single-collection package" as the first line of the log)<br></div><div><br></div><div>Then try it:<br></div><div>$ racket<br></div><div>> (require dummy)<br></div><div>
It works!<br></div><div><br></div><div>Or is this patch way too naive for some reason?<br></div><div><br></div><div>Laurent<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 3, 2013 at 4:37 PM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(I completely agree with you, so I'll take it off-line.)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
30 minutes ago, Laurent wrote:<br>
> On Mon, Jun 3, 2013 at 2:44 PM, Eli Barzilay <<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>> wrote:<br>
><br>
> Yesterday, Laurent wrote:<br>
> > On Sun, Jun 2, 2013 at 1:47 PM, Eli Barzilay <<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>> wrote:<br>
> ><br>
> > To clarify, because of reasons that I won't go into on the list,<br>
> > the actual chances of me getting this implemented (and of such a<br>
> > change being accepted) are pretty much in the area of "slim to<br>
> > none". <br>
> ><br>
> > That's a bummer. At first sight I'd have thought that it would have<br>
> > just been a matter of creating a directory with the same name as the<br>
> > package, and then decompressing the package into that directory.<br>
><br>
> At the lower level, packages use links, and "raco link"'s default mode<br>
> of work is at the collection level. There is obviously a need for<br>
> packages that correspond to collection roots, but I wanted to see the<br>
> default being the same as the raco-link default (which fits most uses<br>
> that don't come out of the current main tree).<br>
><br>
> Not sure I was clear, or I don't exactly understand what you mean.<br>
> And maybe I'm missing some important point here.<br>
><br>
> But the more I think about it, the less I see why this<br>
> double-directory thing should be the default behavior of the new package<br>
> system (I can understand why it's useful for plt packages though).<br>
> Even Carl's "mischief" package doesn't make use of collections like<br>
> that.<br>
> Jen's "this-and-that" does, though, but then every collection of his<br>
> package must have a name that is different from any existing collection.<br>
> (And actually I think that's a bad idea, and that he should split his<br>
> package into several single-collection packages −unless they are<br>
> tightly related− because I don't want to install all his collections if I want<br>
> to only try one of them, unless there is a way to install only one<br>
> collection of an existing package?)<br>
><br>
> For example, my personal racket project tree is arranged somewhat like<br>
> that:<br>
> racket<br>
> ├── project-B<br>
> │ └── main.rkt<br>
> ├── project-A<br>
> │ └── main.rkt<br>
> ├── not-yet(?)a-project-C<br>
> ├── my-collects<br>
> │ ├── slideshow<br>
> │ ├── scribble<br>
> │ ├── racket<br>
> │ └── data<br>
> └── misc<br>
> ├── try-this.rkt<br>
> └── try-that.rkt<br>
><br>
> project-A and project-B are git clones.<br>
> my-collects contains all my extensions to racket's collections,<br>
> plus some more generally useful collections.<br>
><br>
> For my personal use, I just do:<br>
> raco link project-A project-B my-collects<br>
> and all is fine.<br>
> I tend to believe it's a quite common tree for racket users.<br>
><br>
> In "my-collects", I have names that would collide with racket's collections,<br>
> so instead of having:<br>
> (require orseau/racket/slideshow)<br>
> as in the former package system, I would now have<br>
> (require some-funny-name/slideshow)<br>
> after renaming my-collects to some-funny-name to make sure it does not<br>
> collide with anything else.<br>
><br>
> ... and since I don't want to invent a funny name for each extension of a<br>
> racket collection I do, I prefer to put them all in a single package and<br>
> collection.<br>
><br>
> Now if I were to follow the new package system, I'd need to change my<br>
> tree to:<br>
> racket<br>
> ├── misc<br>
> │ ├── try-that.rkt<br>
> │ └── try-this.rkt<br>
> ├── some-funny-name<br>
> │ └── some-funny-name<br>
> │ ├── data<br>
> │ ├── racket<br>
> │ ├── scribble<br>
> │ └── slideshow<br>
> ├── not-yet(?)a-project-D<br>
> ├── project-A<br>
> │ └── project-A<br>
> │ └── main.rkt<br>
> └── project-B<br>
> └── project-B<br>
> └── main.rkt<br>
><br>
> which is a mess. And I would also need to change my git repos to<br>
> match that structure, which looks awkward.<br>
> /But/ I don't care if the tree of the packages I *install* look like that.<br>
><br>
> So what I would like is to keep my tree like the first one, but the<br>
> package system can still install like the second one.<br>
><br>
> My proposal was that for single-collection packages, I could keep<br>
> my tree like the first one, my git clones like project-A/main.rkt, and<br>
> tell the package manager (probably in the info.rkt file) that it is a<br>
> single-collection package so that when it installs it in the<br>
> installed-package-directory-that-I-will-not-look-into it generates a tree<br>
> like the second one.<br>
><br>
> Well, the reason I think that plain collection packages are important<br>
> is it will simplify dealing with packages, and lower the investment<br>
> threshold that you need to publish a package. Along the same line,<br>
> there should also be a way to put out just a single file (or very few)<br>
> as a first step where I make some code public but with absolutely<br>
> minimum effort on the publisher's side. See for example the<br>
> "Processing" thread, where Sean said that people who do these kind of<br>
> thing "don't even know what source control is, let alone packages" --<br>
> so the existence of such a crowd is a perfect reason for a single-file<br>
> thing being another important point on the code distribution spectrum.<br>
><br>
> I entirely agree with that, and I think it is of utmost importance for a<br>
> programming language (and system) to make sure that its users can<br>
> easily share code. Probably all of you agree with that, but I want to<br>
> emphasize that it's really important to put as much effort as required<br>
> into that.<br>
><br>
> Don't get me wrong, I really like the steps forward taken with the new<br>
> direction of the package system, but right now there's a psychological<br>
> wall that prevents me from publishing more v2 packages.<br>
><br>
> Laurent<br>
><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a> Maze is Life!<br>
</div></div></blockquote></div><br></div>