Discussion:
[Larceny-users] snow install path
Alex Shinn
2015-03-23 22:41:50 UTC
Permalink
Hi,

I'd like to be able to install R7RS libraries for larceny with snow2
(distributed with chibi-scheme), which begs the question of where
to put them.

I could put them under $LARCENY_ROOT/lib/R7RS/, but in
general prefer a system-wide install, such as /usr/local/share/larceny/,
which would require users of snow with larceny to set LARCENY_LIBPATH.
--
Alex
William D Clinger
2015-03-23 23:08:15 UTC
Permalink
Post by Alex Shinn
I'd like to be able to install R7RS libraries for larceny with snow2
(distributed with chibi-scheme), which begs the question of where
to put them.
I could put them under $LARCENY_ROOT/lib/R7RS/, but in
general prefer a system-wide install, such as /usr/local/share/larceny/,
which would require users of snow with larceny to set LARCENY_LIBPATH.
I see two problems with expecting Larceny users to put things in
directories such as /usr/local/share/larceny:

* Windows machines don't have that directory.
* Users of Linux and Macintosh machines may not have permission
to add directories to /usr/local/share. For example, I don't
have permission to do that on one of the machines we're using
for nightly builds.

That's why binary distributions of Larceny are released in a self-contained
directory. Users who want to put the larceny script in /usr/local/bin can
do so if they have permission, editing one line to set LARCENY_ROOT, while
users who don't have the necessary permission or are using a Windows machine
can do whatever is appropriate for their situation.

Wherever you put the Snow-related directories, users could edit the
current-require-path initialized by startup.sch instead of setting
LARCENY_LIBPATH. There are several alternatives here.

If you're proposing libraries that should eventually ship as part
of Larceny, then some subdirectory of $LARCENY_ROOT/lib might be
the most appropriate place. You might create a new subdirectory
instead of using $LARCENY_ROOT/lib/R7RS/, which is intended to be
a directory that contains Larceny-specific implementations of the
R7RS standard libraries.

Will
Alex Shinn
2015-03-24 04:16:58 UTC
Permalink
Post by William D Clinger
Post by Alex Shinn
I could put them under $LARCENY_ROOT/lib/R7RS/, but in
general prefer a system-wide install, such as /usr/local/share/larceny/,
which would require users of snow with larceny to set LARCENY_LIBPATH.
I see two problems with expecting Larceny users to put things in
* Windows machines don't have that directory.
Good point, we'd need a separate path on Windows regardless.

* Users of Linux and Macintosh machines may not have permission
Post by William D Clinger
to add directories to /usr/local/share.
This is already handled by being able to specify a custom install prefix.
For example, a *nix user could maintain ~/bin, ~/lib, etc., setting $PATH
and $LD_LIBRARY_PATH accordingly, and install their own packages
with "make PREFIX=$HOME install". They would specify the same prefix
for snow.

If you're proposing libraries that should eventually ship as part
Post by William D Clinger
of Larceny, then some subdirectory of $LARCENY_ROOT/lib might be
the most appropriate place.
Snow is basically CPAN for Scheme, so I doubt most of these would want
to ship with larceny for several reasons:

1. licensing differences
2. size (the number of libraries should quickly grow to the hundreds)
3. release schedule differences
4. conflicting packages (e.g. competing implementations of the same SRFI)

So if we use $LARCENY_ROOT, the lib/Snow might be best.
Is there a way to programmatically determine $LARCENY_ROOT?
For the relative path I can use:

larceny -quiet -nobanner -- -e '(begin(write(current-require-path))(exit))'
--
Alex
William D Clinger
2015-03-24 11:44:34 UTC
Permalink
Post by Alex Shinn
So if we use $LARCENY_ROOT, the lib/Snow might be best.
Is there a way to programmatically determine $LARCENY_ROOT?
larceny -quiet -nobanner -- -e '(begin(write(current-require-path))(exit))'
larceny -quiet -nobanner -- -e '(begin (system "printenv LARCENY_ROOT") (exit))'

or

larceny -quiet -nobanner -- -e '(begin (display (getenv "LARCENY_ROOT")) (newline) (exit))'

or

larceny -r7rs -program showroot.sps

where showroot.sps is a file containing something like

(import (scheme base) (scheme write) (scheme process-context))
(display (get-environment-variable "LARCENY_ROOT"))
(newline)


Will

Loading...