unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.homelinux.net>
To: William ML Leslie <william.leslie.ttg@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: Running non-scheme scripts: some thoughts
Date: Thu, 12 Jul 2012 09:40:59 +0200	[thread overview]
Message-ID: <87mx35qvec.fsf@neil-laptop.ossau.uklinux.net> (raw)
In-Reply-To: <CAHgd1hHGQrck0uP8Hxs+2=Ud5oAfa0_OfMRN3woAjVafW0rrxg@mail.gmail.com> (William ML Leslie's message of "Thu, 12 Jul 2012 13:27:31 +1000")

William ML Leslie <william.leslie.ttg@gmail.com> writes:

> For most entry-points, there is no extension. When you install your
> program, you normally install it as /usr/bin/foo, rather than
> /usr/bin/foo.[ss|scm|py|js|whatever].  This is the motivation for
> guile-foo symlinks or --lang options.  I favour the symlinks slightly,
> because not all languages are going to work with guile's extended
> mesh-wow system, and indirection via env already costs you one
> argument.

Yes, and in the hoped future when Guile runs Python better and faster
than any other implementation, we certainly need the symlinks so that
someone can do

# cd /usr/bin && rm python && ln -s guile-python python

to let Guile run all existing Python programs on their system.

Then, clearly, "guile-python" needs to handle all the command line
arguments that are traditional for Python - not the traditional Guile
arguments - and munge them into a suitable startup incantation/sequence
for Guile.

And then there are two detailed arguments which both suggest handling
"guile-python" within the main Guile executable, instead of in an
accompanying shell script.  Firstly it's more flexible to transform
guile-python arguments directly into Guile startup code, instead of a
two step transformation first to traditional Guile arguments and then to
code.  (What if there isn't an appropriate traditional Guile argument?)
Secondly it feels more maintainable and integrated to have that logic
within the main Guile code, instead of in a shell script to one side.

I think that means the necessary support should be added to
compile-shell-switches in (ice-9 command-line), and to the C code in
script.c that calls that, to allow compile-shell-switches to set up for
different languages according to $0.

Regards,
        Neil



  reply	other threads:[~2012-07-12  7:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 15:31 Running non-scheme scripts: some thoughts Ian Price
2012-07-11 15:37 ` Andrew Gwozdziewycz
2012-07-11 22:15   ` Krister Svanlund
2012-07-12  3:12     ` nalaginrut
2012-07-12  3:27       ` William ML Leslie
2012-07-12  7:40         ` Neil Jerram [this message]
2012-08-26 21:16 ` Ludovic Courtès
2013-01-21 11:33   ` Andy Wingo
2013-01-21 16:19     ` Ludovic Courtès
2013-01-22 14:59       ` Andy Wingo
2013-01-22 21:45         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mx35qvec.fsf@neil-laptop.ossau.uklinux.net \
    --to=neil@ossau.homelinux.net \
    --cc=guile-devel@gnu.org \
    --cc=william.leslie.ttg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).