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

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Oct 25 23:06:30 EDT 2005

On Oct 25, Yoav Goldberg wrote:
> > > 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?

They are plt-scheme packages, usually containing a collection that can
be unpacked and installed by users.  They are a basic way of packaging
up code, which is the functionality that planet builds on.

mzc can create these .plt packages, see its usage and help desk.

> 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",

Why?  Do you plan to distribute them as separate packages?

If you do, then put them in your addons directory, and you can still
use that.  To see where that is, run this:

  (build-path (find-system-path 'addon-dir) (version) "collects")

> 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,

I couldn't parse all of that.

> 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.

That should be perfectly fine as long as you distribute your thing as
a single collection, which makes sense if you don't want to invest in
making a separate distribution with just the midishare interface.  If
you do want to make a separate distribution, then doing that through
planet will make more people use it since it will be more convenient.

Otherwise (and assuming you don't want to write your own code
distribution system), you will just have to tell people to download
and install both .plts to make things work.

> > > > > [...] 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).

Planet is specifically intended to make downloading code easier.  If
the server crashes or dumped, you're stuck in only a slightly better
way than you'd be stuck if plt-scheme is dumped.  So for maximum
robustness, would you also learn how to maintain the C core and the
huge amounts of Scheme code?

But really, how is this different than relying on your OS vendor for
downloading packages?  (Or do you install stuff from CDs and get
nothing else?)  How is this different than CPAN, CTAN, etc, which rely
on repository servers?

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.