guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] add language/wisp to Guile?


From: Dr. Arne Babenhauserheide
Subject: Re: [PATCH] add language/wisp to Guile?
Date: Thu, 23 Feb 2023 09:51:55 +0100
User-agent: mu4e 1.8.13; emacs 28.1

Maxime Devos <maximedevos@telenet.be> writes:

>> ‘#! ... !#’ comments aren't legacy; they exist to allow putting the
>> shebang in the first line of a script, and to pass additional
>> arguments to the Guile interpreter (see: (guile)The Top of a Script
>> File) (*).

This is awesome, by the way.

It’s what allowed me to write wisp scripts that just work without having
wisp shipped by starting as bash script, pre-compiling the language
files, and then exec'ing guile with the right arguments that interprets
the file as module and runs the code inside.

>> Furthermore, according to the kernel, #!r6rs would mean that the
>> script needs to be interpreted by a program named 'r6rs', but
>> 'guile' is named 'guile', not 'r6rs'.  (I assume this is in POSIX
>> somewhere, though I couldn't find it.)

We could fix that by installing a binary named r6rs.

> Thinking a bit more about it, it should be possible to special-case
> Guile's interpretation of "#!" such that "#!r6rs" doesn't require a
> closing "!#".  (Technically backwards-incompatible, but I don't think
> people are writing #!r6rs ...!# in the wild.)

Do you need the closing !# if you restrict yourself to the first line?

> Still doesn't really address the problem though, as Scheme scripts (or
> scripts in another language) may need to start with a shebang and
> "#!lang" or "#lang" is not a valid comment in all languages.  (E.g., I
> don't think it's valid Pascal, though I only have read some Pascal
> code, I haven't looked at the specification.)

I think itmust be ignored in all languages that work as scripts in
POSIX. So I would expect that support for ignoring #!... in the first
line is very widespread.

Also since the language implementation is in Guile, this could simply be
added for Guile. That may prevent using this file from other
implementations of the language, but it should work well enough as a
first step.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]