From: Ian Price <ianprice90@googlemail.com>
To: guile-devel@gnu.org
Subject: Running non-scheme scripts: some thoughts
Date: Wed, 11 Jul 2012 16:31:15 +0100 [thread overview]
Message-ID: <87bojm2u2k.fsf@Kagami.home> (raw)
Hi,
Though guile is really a multi-language vm, it does not provide a simple
way to run scripts for languages other scheme from the command line. I
think we should add a --language switch that takes a mandatory argument,
and use that to determine the language.
Other solutions for dealing with multiple languages have been proposed
before, including guessing the language from the file extension[0], or from
the file itself (via a something like racket's #lang).
While guile could move towards those at a later date, I think the
--language switch is a good one for now. Firstly, it could be
implemented simply with, I think, only modifications to (ice-9
command-line). Secondly, it is compatible with these other designs; a
future language guessing guile could honour --language, and where that
switch is not provided would be free to guess; a similar situation
would occurs if we went with a #lang type solution.
Anyway, some thought needs to be taken as to how this will integrate
with the other switches. In particular: -s, -c, -l, -e, and maybe
--listen, -q, and --use-srfi.
I think that if --language=LANG is specified, then the files given by
-s, and -l should be treated as though they contained LANG source
code. Similarly, the string argument to -c, as a string of LANG. -e
would ideally be a function in LANG, but I don't know the details of how
this works in the other languages, and so could be left off for now.
If guile was used interactively with the --language switch, it would
give you a guile repl already in that language, similar to if we did ,L.
I think this is how it should interact with --listen too, though I'm not
positive.
-q, or rather, when -q is not supplied, is tricky. I think we should
just assume that it is always going to be in Scheme. I'm open to
suggestions.
I don't know how module interaction works in other languages, so I also
can't comment on the suitability of --use-srfi.
So, thoughts? Counter-proposals? Flames? Have I missed out anything
particularly obvious?
tl;dr +1 to add a --language switch to guile :P
[0]. I don't personally like this solution, since it seems fragile, and
it's not clear how it would interact with the -x switch.
--
Ian Price
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
next reply other threads:[~2012-07-11 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 15:31 Ian Price [this message]
2012-07-11 15:37 ` Running non-scheme scripts: some thoughts 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
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=87bojm2u2k.fsf@Kagami.home \
--to=ianprice90@googlemail.com \
--cc=guile-devel@gnu.org \
/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).