From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0CxULJhVsF6kYgAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 17:49:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0KFVM6JVsF5rRAAAB5/wlQ (envelope-from ) for ; Mon, 04 May 2020 17:49:22 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1FFF8944522 for ; Mon, 4 May 2020 17:49:20 +0000 (UTC) Received: from localhost ([::1]:48298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVfDU-0005uG-8X for larch@yhetil.org; Mon, 04 May 2020 13:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVfDC-0005u3-Kz for guix-patches@gnu.org; Mon, 04 May 2020 13:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVfDC-0003IF-BH for guix-patches@gnu.org; Mon, 04 May 2020 13:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVfDC-0002KB-6b for guix-patches@gnu.org; Mon, 04 May 2020 13:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40373] [PATCH] guix: new command "guix run-script" Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 May 2020 17:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40373 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Konrad Hinsen Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 40373@debbugs.gnu.org Received: via spool by 40373-submit@debbugs.gnu.org id=B40373.15886145178904 (code B ref 40373); Mon, 04 May 2020 17:49:02 +0000 Received: (at 40373) by debbugs.gnu.org; 4 May 2020 17:48:37 +0000 Received: from localhost ([127.0.0.1]:33912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVfCn-0002JY-83 for submit@debbugs.gnu.org; Mon, 04 May 2020 13:48:37 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVfCm-0002JL-2j for 40373@debbugs.gnu.org; Mon, 04 May 2020 13:48:36 -0400 Received: by mail-qt1-f196.google.com with SMTP id w29so245542qtv.3 for <40373@debbugs.gnu.org>; Mon, 04 May 2020 10:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5wE+kA6HwWQ2Vu3Pc4flTWgMHjbTSTsGb51gCVvgBIo=; b=Z4NdvwsQuLCq3ZgbmgdYqCogywr2lvo41iNpt3nuk82jNEaTHtKe/e6LCJLc65K+sq pLdaBxUSULcqriVHyZydUJ4dpo5j7gJJmwUkZS2T+OBmVHxkk9YYHHbGrCjXp11dgm7G wgV3CZVjCUyV54bXFtIY5YdgyVBgXOgPMhnyrlZX82z80zCxPEcpa5WjQtKdBbnHYLKo tnwZv6s6uWY4MKSAigKbCEDs9gUaJGhzuc2N8mfpOkwkY5WUTyIIsc8T+a0GS5Lmos09 m/4Z3AiZGGxYOio0MHn+gtGChbM1rpuUxXjinyOecLqpymr2ytUkV87Sh9Qg9+Td/leQ 0/6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5wE+kA6HwWQ2Vu3Pc4flTWgMHjbTSTsGb51gCVvgBIo=; b=U6QTScuckc+wZmbkUzbQieY/wsa568ehS8FwQv7toZ64iS5Y+93fEIBsZmJG9rBpu9 d8sHTVGczHzzv/a+d5ogZbRnZJdfhiYpqqK28ebOY98YckvN81BLunwQcjkiEj/GspwK dl2w8u0OaVhT8xZSeDemNCuP8JBgzeK6LD+0f4i2lQkEyS/kQfgf/h7jxXhFzTzAgC/Y +WInSrqTfSzPV+tSjnux2IIh0Ps+6tfQB1fCm3w6crYz768LvuXvx8FeOQJBYH2k+ag4 04fMu8k76BFeQanlGIAHfHlcFtU3yXdW8BMg9NiHGIhn255JaO5R2lFu6eTxa3Y9M5bY +GTA== X-Gm-Message-State: AGi0PuZ/4jkpKmFzTqyYJTEaRXJqnDIH9U1IYS0rNFIYEWuyVr/b8Jit KUN6m7l3ZU0Ul3AAPEIevyC8cecG6yy1eS05+E0= X-Google-Smtp-Source: APiQypJxD2AWD4G5jFi3uQ7v7J7avfPjEsWfyiKNgMnLGfkI2c2IeRCt/t6566V44K6UpSDHeAiCnTG5jA3G4WNT9nQ= X-Received: by 2002:ac8:4e0f:: with SMTP id c15mr225700qtw.211.1588614510429; Mon, 04 May 2020 10:48:30 -0700 (PDT) MIME-Version: 1.0 References: <875zeiudjm.fsf@gnu.org> <87mu7slwwh.fsf@gnu.org> <87mu7na8g6.fsf@gnu.org> In-Reply-To: From: zimoun Date: Mon, 4 May 2020 19:48:19 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=Z4NdvwsQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.49498865415439]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.13), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[fastmail.net]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[zimontoutoune@gmail.com,guix-patches-bounces@gnu.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[fastmail.net:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[40373@debbugs.gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: OyV7h4kHmg8q Hi Konrad, On Mon, 4 May 2020 at 15:55, Konrad Hinsen wrote: > True, not always. But for scripts it's never. We have to find some nice > three-valued logic rhetoric that applies to all situations ;-) > > Command line: > - read an expression, > - eval it, > - print the result of the evaluation (if any), > - and finally loop to process the next expression > > Scripts: > - read the script file1, > - eval it, > - print the textual output of the script (if any), > - and finally loop if there is more than one script file. > > That makes "print" look optional in both cases. It is how I personally understand all that. :-) So that's why I proposed "guix repl --script" (in short '-s') ;-) In this frame of "guix repl", the future additions/evolution could be: --eval,-e for evaluating one expression just after the script is loaded --debug for starting the "debugging" VM engine (personally never used with Guile) --language for switching to WISP (optimistic evolution of GWL :-)) --use-srfi for loading SRFI modules So it ends up with this kind of command-line: guix repl -L /path/to/stuff --use-srfi=9 guix repl -L /path/to/custom -s file.scm guix repl --language=wisp --script file.wsp guix repl -s file.scm -e '(package-name foo)' Well, 'repl' meaning "use the interpreter in the context of Guix". Is 'repl' enough meaningful for these use cases? Personally, I think so. :-) All the best, simon