GNU bug report logs - #44612
Read standard input in `guix repl'

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Fri, 13 Nov 2020 09:42:01 UTC

Severity: normal

Tags: notabug

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 44612 <at> debbugs.gnu.org, Bengt Richter <bokr <at> bokr.com>
Subject: bug#44612: Read standard input in `guix repl'
Date: Mon, 16 Nov 2020 13:52:23 +0100
Hi,

Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hi,
>>
>> Bengt Richter <bokr <at> bokr.com> skribis:
>>
>>> On +2020-11-13 10:41:38 +0100, Pierre Neidhardt wrote:
>>>> `guix repl` is a fantastic, hassle-free tool to bind Guix with
>>>> third-party languages.  I've done it here:
>>>> 
>>>> https://github.com/atlas-engineer/nyxt/blob/2-pre-release-4/libraries/ospama/ospama-guix.lisp
>>
>> I recommend using ‘guix repl -t machine’
>
> Looks like `-t machine` has the same issue.
> This does what I want:
>
> $ echo "(display \"Hi.\\n\")" | guix repl -t machine /dev/stdin
> Hi.
>
>
> This does not:
>
> $ echo "(display \"Hi.\\n\")" | guix repl -t machine  
> (repl-version 0 1 1)
> Hi.
> (values (non-self-quoting 2052 "#<unspecified>"))

The general idea is that the REPL protocol allows you to offload
computations to the ‘guix repl’ process and to read the result of those
computations.  Side effects such as writing to stdout are not treated,
but they’re mostly beyond the scope of ‘guix repl’.

>> and keeping the REPL process around instead of respawning it for every
>> expression.
>
> At first glance, we would want to do this indeed.
>
> But in the case of Nyxt, there would be no point when to terminate the
> process, so it would be around for the whole time Nyxt is running, which
> may not be desirable.

I think it’s desirable since it saves on CPU costs.

> Alternatively, I could simply keep it alive for a given duration (1
> minute?) and automatically spawn it if the process is dead.

Yes, that’s a reasonable tradeoff.

Thanks,
Ludo’.




This bug report was last modified 4 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.