Executable Programs with Guile Arne Babenhauserheide (06 Jul 2016 21:50 UTC)
Re: Executable Programs with Guile taylanbayirli@xxxxxx (06 Jul 2016 23:20 UTC)
Re: Executable Programs with Guile Marc Nieper-Wißkirchen (07 Jul 2016 06:24 UTC)
Re: Executable Programs with Guile Per Bothner (07 Jul 2016 06:52 UTC)
Re: Executable Programs with Guile Marc Nieper-Wißkirchen (07 Jul 2016 07:14 UTC)
Re: Executable Programs with Guile John Cowan (07 Jul 2016 11:09 UTC)
Re: Executable Programs with Guile Per Bothner (07 Jul 2016 12:30 UTC)
Re: Executable Programs with Guile John Cowan (07 Jul 2016 14:49 UTC)

Re: Executable Programs with Guile taylanbayirli@xxxxxx 06 Jul 2016 23:20 UTC

Arne Babenhauserheide <xxxxxx@web.de> writes:

> Hi,
>
> SRFI-138 describes the Chibi and Larceny approaches, but is currently
> missing Guile.
>
> A difference in Guile is that it uses -L to add a directory to the
> library search path.
>
> Also the usual way to run Guile Scheme as a script with shell-deferring
> is to exec the commandline. Here’s an example:
>
> http://www.draketo.de/proj/py2guile/#sec-2-2-3-2-2
>
> Other ways to run Guile scripts are documented in the Scripting-Examples
> of the Guile Reference:
> https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Scripting-Examples.html#Scripting-Examples
>
> Best wishes,
> Arne

The SRFI describes the command-line interface of an executable called
"compile-r7rs".  Guile or any other Scheme implementation could detect
when ARGV[0] is that string (so a symlink or hardlink of that name to
the normal guile executable will work) and implement the described CLI.
Or it could provide a separate program implementing that CLI as a
wrapper for guile.

Chibi and Larceny will have to do the same, although they may just use
their default behavior regardless of the value of ARGV[0], given that
their CLI is already a superset of the CLI described in SRFI 138.

The output of Guile's implementation of compile-r7rs could be a script
with the exec hack you mention.

All of this is a matter how a given Scheme implementation implements
SRFI 138.  I believe Chibi and Larceny were just given as examples since
they already have a CLI similar to that of SRFI 138.

Taylan