[plt-scheme] PlaneT, plts and distributing software.

From: Yoav Goldberg (yoav.goldberg at gmail.com)
Date: Tue Oct 25 22:41:24 EDT 2005

> > > But it is installed as a collection.  The planet cache is used as
> > > another item on the list of directories to search (when the
> > > `planet' syntax is used to specify a module.)
> > ... install it as a collection in a way typical users could find it,
> Typical users "find it" in the same way they find other sources.
> Either in the plt tree, or in the addons dir.
I knew the planet cache is "somewhere" on my machine. Had no idea
where until Noel's post earlier in this thread...

> > and from then on require it with "lib".
> Planet is specifically designed to not go back to requiring it with
> "lib".  If you want the package to be
> * installed in a "conventional" way,
> * used with a plain "lib",
> * works in a way that is independent of some server,
> then you should use plan .plt files -- they do exactly that.
The problem is mostly my ignorance, then. What are .plt files, and how
do I use them?

> > > > While we're at it, I think it will also be extremly usefull to
> > > > add the <path-of-main-file>/collects to the
> > > > current-library-collection-paths[2] list, [...]
> > > How do you determine the "main-file"?  You're talking about the
> > > file that is used with "-f" -- what about multiple "-f"'s and
> > > direct use of "load"?
> > Choose a convention. "The first file specified with -f". Whatever.
> That doesn't work.  MzScheme just sees a bunch of loads.  Adding
> arcane command-line flags (like something that will load a file, and
> add its directory to the collection paths) is *really* not needed...
Ok. I find it usefull, but whatever.

> > > If you want to just require some module relative to the current
> > > one, then you should just use a relative name (which is always
> > > relative to the source file that does the require).
> > Let's say I use two collections, one of them references the other,
> > and I'm not sure they will be available on the end-user machine. I
> > also don't want to put files outside of "my" directory, esp. on
> > Win32.
> Make foo/bar.ss use (require "../blah/moo.ss") and tell users to put
> "foo" and "blah" in the same place.  If you're not sure that one is
> installed, then i don't see how you expect to make things work in any
> way.
I have two collections: "midishare" and "music". Code in "music" uses
the functionality in "midishare", and it does so with "(require (lib
"whatever.scm" "midishare"))". I don't use relative paths for that
require, because, well, they are different "code units", and refering
from one to the other using a relative path is ugly.
The end user won't have any either of these collection on his machine,
and that's exactly why I want to distribute my application with both
collections, and make them available without putting files outside the
application's directory, without setting environment variables, and
without loosing the conveniance of using collections and being forced
to use relative paths with a long list of ../../ for everything I
require inside my own library code.

> > > > [...] if I can't control the server, I'm not going to use it.
> > > (That's a very 90's thing to say.)
> > Not really, in this case.
> > I'm not going to distribute software that relies on your server
> > being up in order to work, because I can't control it.
> That *is* a *very* 90's thing to say.  I use tens of servers every day
> that I'm aware of, and that I don't control.  Planet was designed to
> make it easy to distribute software for developers in a
> near-transparent way.  It takes care getting new versions etc etc.  If
Great. Now let's say I write an application using tons of direct
requiring from planet, give/sell it to someone, and then planet server
is down for a week, or goes down altogether, or goes to a new
incompatible version or whatever. MY CLIENTS WON'T BE ABLE TO RUN MY
CODE ON NEW MACHINES. I don't want that. Letting me run my own server
is one solution (I wouldn't use it personally because it's way to
expensive for me, but I guess real companies will find it to be very
nice), and letting me use .plt files (nice to know about them) is
another on, I guess (I don't really know what they are yet).

> it doesn't fit your needs, you should distribute your packages as .plt
> files, or design your own distributed planet alternative.
> Like I said, if you don't want to rely on any server at all, and you
> want to use a plain "(lib ...)" syntax, then you should use plain .plt
> files -- I don't see anything that you want beyond .plt files, and
> more than that -- you don't want any of the extra features of a
> distributed system.
We'll, as I said above, my ignorance is part of the problem. I had no
idea these .plt files exist, let alone what they do. Will look it out.


Posted on the users mailing list.