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: Sun, 26 Feb 2023 17:14:19 +0100
User-agent: mu4e 1.8.13; emacs 28.1

Maxime Devos <maximedevos@telenet.be> writes:
> Op 26-02-2023 om 08:45 schreef Philip McGrath:
>> What I'm trying to advocate is that programs should say in-band, as part of 
>> their source code, what language they are written in.

In-band is not the same as in-language.

I agree that it should be part of the source code — at least for
executable files - but this is already possible.

I’ve been using shell-indirection for many years that ensures that files
for the different languages are recognized and compiled with the correct
language. It does not look as clean, but it allows solving a lot of
problems. It ensures that when language/wisp.scm is not available, it
first gets compiled as scheme, and then the wisp files are used as wisp,
as in the file dryads-wake.w:

#!/usr/bin/env bash
# -*- wisp -*-
# ensure that (language wisp) is pre-compiled
if ! guile -L $(dirname $(realpath "$0")) -C $(dirname $(realpath "$0")) 
--language=wisp -c '' 2>/dev/null; then
    guile -L $(dirname $(realpath "$0")) -C $(dirname $(realpath "$0")) -c 
'(import (language wisp spec))' >/dev/null 2>&1
fi
# run dryads-wake as module to ensure it is used pre-compiled
exec -a "$0" guile -L $(dirname $(realpath "$0")) -C $(dirname $(realpath 
"$0")) --language=wisp -x .w -e '(dryads-wake)' -c '' "${@}"
; !#
; … code follows …

This is an extra-linguistic feature, but it defines in the source-code
what language is used for the different parts. And it has its own kind
of elegance. Not in isolated language design, but in leveraging
different parts of the GNU system to provide more capabilities than
available from any of its parts.

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]