From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aKpjOU3TrGOh8gAAbAwnHQ (envelope-from ) for ; Thu, 29 Dec 2022 00:37:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id DzF3OU3TrGO0YwAA9RJhRA (envelope-from ) for ; Thu, 29 Dec 2022 00:37:49 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.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 C65E312D2 for ; Thu, 29 Dec 2022 00:37:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAfz8-0000c4-HA; Wed, 28 Dec 2022 18:37:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAHic-0004Eu-PX for guix-devel@gnu.org; Tue, 27 Dec 2022 16:42:42 -0500 Received: from simopolis.xyz ([202.61.230.221] helo=mail.simopolis.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAHib-00073H-73 for guix-devel@gnu.org; Tue, 27 Dec 2022 16:42:42 -0500 From: Russell Sim DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simopolis.xyz; s=dkim; t=1672177358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s1ihSs+YUUCBvygqilnb1kbgaUcQLxQOxoFxZPQnqBE=; b=CfcdZ8LW2cxI81f5EsEgs2u+XV07r7p5QbUIgrha7XUWr0XTG71KUaPLi2BT4+SwcT4Pq3 RhuRKV4ayjF7dPoWURx5ZO511BUrSErp5Rjf+gdcE27TwjuBpGEa0GuvSbYZe8sG4obc2q 4PM4CzmuVER8E1ROINyJjaRrTKaofDrf+6nEQ1ffeEROi4NW00/ZK24jueIcZddLpq5lZV ULl0/oYuXgX2X/MZvr204Oyzq3EHmaLQ133aJ0sGfUx7YMhiZJsWWNfbh+8cBnsDutKUAW bWDMVRO7kQYDPaRD32uJPSoJYkJ+zfcgAkBOMb9vzDTn1vQTaf6he3SaXCOXJw== To: jgart , John Kehayias , guix-devel@gnu.org Subject: Re: Should Guix support writing CLI Common Lisp scripts? (Think Roswell) In-Reply-To: References: <87o7rowre7.fsf@simopolis.xyz> <87r0wkk8kx.fsf@protonmail.com> <24871675f2ccdf7f3c46c46832b3f3f9@dismail.de> <5706580cffe4acd70e7a790ff7df810b@dismail.de> Date: Tue, 27 Dec 2022 22:42:36 +0100 Message-ID: <87k02cwmk3.fsf@simopolis.xyz> MIME-Version: 1.0 Content-Type: text/plain X-Spamd-Bar: / Received-SPF: pass client-ip=202.61.230.221; envelope-from=rsl@simopolis.xyz; helo=mail.simopolis.xyz X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_PDS_OTHER_BAD_TLD=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 28 Dec 2022 18:37:17 -0500 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672270669; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=s1ihSs+YUUCBvygqilnb1kbgaUcQLxQOxoFxZPQnqBE=; b=dJoddcWdseEtjxReO1oHM+qAd6eQ4EzQOKT/oQGUC90wuCu2/hH/CxfIPNr13Jm+9PR4+o Liefia3udE7YuLIpGkvn7T/qL/XhIdciIkZX7AYnImRCQcE+48EPo7QGPn1XPNvMJCgh+y NJES0v3GRtfNM/1x4CAfBCnTWZo2/c9m3bhD8lm5gPYmS4l4RzD6keFQDQ4ErN5jw9B3cV eXhexCjj9bJafNx0QFZAR0JFHYEIgWLD37lCt6AVZotZNTPSySWzhD5nBfxwFng7vcxGaM p7lMN8TanggKkD/tJmhyMDUELkRco2po1ub+wguZbNMxOSkDoTZmpL8ffrtB5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=simopolis.xyz header.s=dkim header.b=CfcdZ8LW; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=simopolis.xyz ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672270669; a=rsa-sha256; cv=none; b=ccsdVDQWC44IioNycDoogS4nPtkaN2vujglPdrKD4TGFUSkzR1UvMFkG9rntFSfOj3xIEe veU1TRbiQQPoSl/WARbL1LMCRzvsuLlvg8XyclIRX9YmIAy5L/DNudd7lq5e0pJIGqHKiP hRAR0ealHMbCcfjrdldwDCDxzZ9yWlKIox7GtAPF3GCpejir+w9oy6fUf8BfulxmWEnKZF gzCFVpAKqXTVwdLZxleshFhFVID4tHSCioEUTNbzMTn28DSlHAO7bFGDCYNg5r/A+upi/+ hDHiPtWxjBFCUk4KyL6fDZh9Fdrq/I9Kz9ug7cQ3wNimlAJn8s7tpRBzadxG/A== X-Spam-Score: -3.73 X-Migadu-Queue-Id: C65E312D2 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=simopolis.xyz header.s=dkim header.b=CfcdZ8LW; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=simopolis.xyz X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.73 X-TUID: OCaVucTDtLjp "jgart" writes: >> What about something like this? >> >> --8<---------------cut here---------------start------------->8--- >> #!/bin/sh >> #|-*- mode:lisp -*-|# >> #| >> exec guix shell sbcl -- sbcl --script $0 "$@" >> |# >> >> (format t "test~%") >> --8<---------------cut here---------------end--------------->8--- >> > > Yaaaaas! I have found there are limitations with the `--script' option. Namely that ASDF can't be used because it disable the userinit file. I'm not sure how to locate where that file is in guix. So to avoid that the one option is to emulate the behaviour, which is a bit more complicated. :/ so a full script example would be more like this --8<---------------cut here---------------start------------->8--- #!/bin/bash #|-*- mode:lisp -*-|# #| exec guix shell \ -m $(dirname "${BASH_SOURCE[0]}")/../manifest.scm \ -- sbcl \ --noinform \ --disable-ldb \ --lose-on-corruption \ --disable-debugger \ --non-interactive \ --eval "(set-dispatch-macro-character #\\# #\\! (lambda (stream char arg) (declare (ignore char arg)) (read-line stream)))" \ --load $0 "$@" |# (unless (let ((*standard-output* (make-broadcast-stream)) (*trace-output* (make-broadcast-stream)) (*error-output* (make-broadcast-stream))) (asdf:load-system :balanced-parentheses)) (warn "Failed to load balanced-parentheses") (uiop:quit 1)) (format t "Success~%") --8<---------------cut here---------------end--------------->8--- This is using a guix manifest, because I want this for development with a local project, but any guix shell options should work. So I switched it to bash, to support the manifest loading, but sh would work work if you are happy listing the dependencies. Cheers, Russell