[Larceny-users] on porting to larceny

Marco Maggi marco.maggi-ipsu at poste.it
Sun Dec 28 04:08:48 EST 2008


"William D Clinger" wrote:
>Marco Moggi wrote:
>> The built in PARAMETERIZE does not act as a
>> LETREC-like form:
>
>That has been logged as a requested enhancement
>(ticket #601).

Thanks.

>> If I have not missed it in the source, the FFI
>> does not implement peekers and pokers for "long
>> double" and "long long".  They are unusual, but if
>> the cost of adding them is small...
>
>I don't think they are supported by all C compilers,
>so trying to support them in our basic FFI might
>compromise portability.  Perhaps they should go into
>a dynamically loadable library.

I agree. In fact, Nausicaa already has a Stubs
project to collect C language libraries that
do "strange" things. I can add a library
to handle "long long" and "long double" values as
blocks of memory, and provide the to_string
feature (so that, for example, one can use
the GNU Scientific Library's vectors and matrix
functions for "long double").

>I revised the main Wiki page.

Looks good to me.

>> Cough... sorry for making myself a nuisance,
>> but can LARCENYLIBPATH be renamed to
>> LARCENY_LIBPATH? It would be more readable.
>
>Will do.

Thanks. :-)

>> I tried to run compiled Larceny programs using
>> the "binfmt_misc" Linux  kernel module, but it has
>> not worked  because "larceny -r6rs  -program" does
>> not like compiled files.
>
>I don't know anything about binfmt_misc, but I do
>know that Larceny runs compiled top-level programs
>via a "larceny -r6rs -program <mypgm>" command.

My fault! It works. It goes like this:

1. at system boot load the binfmt module
   by putting in a shell boot script (on a
   Slackware system "/etc/rc.d/rc.modules"):

|  /sbin/modprobe binfmt_misc

2. put in a system shell boot script (on Slackware
   "/etc/rc.d/rc.local"):

| if test -f /proc/sys/fs/binfmt_misc/register ; then
|    echo enabling Larceny compiled files execution
|    echo ':LARCENY:M:2:fasl::/opt/larceny/last/scheme-script:'\ |      >/proc/sys/fs/binfmt_misc/register
| else
|    echo 'skipping Larceny compiled files execution (binfmt_misc not ready)'
| fi

   which tells the Linux kernel to do the following
   when running an executable file: look at offset 2
   in the file for the string "fasl", and if it is
   there run the file using the given "scheme-script"
   pathname;

3. write a Larceny program and COMPILE-FILE it,
   obtaining, say, "proof.sps.slfasl";

4. give it a beautiful name and make it
   executable:

|   $ mv proof.sps.slfasl proof
|   $ chmod 0755 proof

5. run it:

    $ ./proof

6. the original source file is not needed,
   we can remove it and install the compiled
   program in a PATH directory.

We can inspect the status of the executable
files record with:

|  $ cat /proc/sys/fs/binfmt_misc/LARCENY

disable it with (as root):

|  $ echo 0 >/proc/sys/fs/binfmt_misc/LARCENY

enable it with (as root):

|  $ echo 1 >/proc/sys/fs/binfmt_misc/LARCENY

and remove this record with (as root):

|  $ echo -1 >/proc/sys/fs/binfmt_misc/LARCENY

Nice! :-)

>> I cannot use COMPILE-STALE-LIBRARIES [...]
>
>That has been logged as a requested enhancement
>(ticket #602).

Fine.

>Are you saying that you have some program A that
>works sometimes but not others, without any
>intervening changes to program A or to any of the
>libraries or to any compiled files at all?

I can say nothing for sure. :-/ I found a precedence
error in my compilation script, but after having
solved it I get a "Client was expanded ..." error
about "(rnrs mutable-string)" when compiling
"(uriel lang)" but I have not changed the Larceny
installation.

Can you confirm that only the timestamps are
involved? I ask this because maybe it is my
laptop (I had a calendar clock reset, so maybe
some timestamp is broken somewhere in the
file systems).

> Larceny's apropos procedure can be
> used to compute a list of *all* variables
> present within the current interaction
> environment.

Thanks this is enough to start.

-- 
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"




More information about the Larceny-users mailing list