unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: j kalbhenn <jkal@posteo.eu>
Cc: guile-devel@gnu.org
Subject: Re: feature request: simple hashbang for executable scripts
Date: Wed, 23 Aug 2017 02:00:46 -0400	[thread overview]
Message-ID: <87pobmomb5.fsf@netris.org> (raw)
In-Reply-To: <20170819090037.GA12397@sph-desktop.fritz.box> (j. kalbhenn's message of "Sat, 19 Aug 2017 09:00:37 +0000")

j kalbhenn <jkal@posteo.eu> writes:

> scripts of other languages usually need just one line to specify the
> interpreter:
>
>     #!/usr/bin/myinterpreter
>
> but with guile we have to add a final !#
>
>     #!/usr/bin/guile !#

The shebang above does not work, because the "!#" is interpreted by the
kernel as an argument to pass to Guile before the script file name, and
then Guile interprets it as a file to load.  Unless "!#" is a file in
the current directory, this will fail, or at least it does for me.

>     or even
>
>     #!/usr/bin/guile -s
>     !#
>
> in my opinion, this is not ideal. from my perspective as a guile user
> this seems to be unnecessarily inconsistent and complicated.

There are advantages to the current approach, but regardless of what our
opinions might be about this, I don't see how we could change this now
without breaking a great many Guile scripts.  Since the earliest days of
Guile, "#!" has been comment syntax that terminates with "!#", and many
Guile scripts depend on this.

For example, it is quite common to put a shell script between #! and !#
that ends by running Guile on the same file.  It is also quite common to
put "-*- scheme -*-" on the second line to that Emacs will recognize the
type of the file.

      Mark



  parent reply	other threads:[~2017-08-23  6:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-19  9:00 feature request: simple hashbang for executable scripts j kalbhenn
2017-08-21  7:04 ` Chaos Eternal
2017-08-21  9:21   ` j
2017-08-23  6:00 ` Mark H Weaver [this message]
2017-08-25  1:30   ` Matt Wette

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=87pobmomb5.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guile-devel@gnu.org \
    --cc=jkal@posteo.eu \
    /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).