From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id fUjtBjWs6WCmVgEAgWs5BA (envelope-from ) for ; Sat, 10 Jul 2021 16:18:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 5oXsATWs6WCmWwAAbx9fmQ (envelope-from ) for ; Sat, 10 Jul 2021 14:18:29 +0000 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 847D91DB13 for ; Sat, 10 Jul 2021 16:18:28 +0200 (CEST) Received: from localhost ([::1]:52756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2DoJ-0004ZV-Jd for larch@yhetil.org; Sat, 10 Jul 2021 10:18:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Do6-0004ZK-V3 for guix-devel@gnu.org; Sat, 10 Jul 2021 10:18:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33598) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2Do5-0005Sk-Rj; Sat, 10 Jul 2021 10:18:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42892 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2Do5-0007TM-HS; Sat, 10 Jul 2021 10:18:13 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: Early feedback on Guix Home References: <87tuloyb6n.fsf@gnu.org> <87y2azr86k.fsf@yoctocell.xyz> <87fsx1t0y1.fsf@gnu.org> <87a6n751cg.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 Messidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 10 Jul 2021 16:18:11 +0200 In-Reply-To: <87a6n751cg.fsf@trop.in> (Andrew Tropin's message of "Wed, 30 Jun 2021 09:10:55 +0300") Message-ID: <87pmvqckws.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , Xinglu Chen Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625926708; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aiP5IcMATFAuJgFoYhC/NE2XBd0NbzD2RNYOWkr8ubY=; b=BHLBpCS0qgYmvtY9O9iLRYhh4EPGoZi35Y8eMLCe4TjHijod20uZlC0vDT9KzbzeSGZ5aP xjfdafPbyDtFFQq4wKCrZi0Z9dOCnj1RUs34oAR+CNxaI+AYZ++pQzOf4yQj2wYnXzrPoN YU0Eb0As0OEH6C7fmwn29aHYLxbyKCuf5jLvUSzLZklQotH5617fW8Mu9FdEH7pDZgngrc nmSjlHhnsnEP1g6xnna7RK6uX7QUhhQqZDQSFiFEQUdHOdhRBDkNBMz+oBqkasKONcAhIS 1DQ/e8yPpt77T+MgvA6K6Jctm5eWlSTwTtTDq2BNmZQsTOu8mwRJG8xAGRgQpw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625926708; a=rsa-sha256; cv=none; b=WIxokDbKYqGeVmhOGZhjfs9mESfJvdVcTJOmc416GcAV0MSnkO0P2BGdkfNHHrN0Typ0ui 7Pd96ykTAJq2d3bn+Zci60t23s+KZAvFLX4ZpemgJd3YnQkorXoLONHWGfsUPiyvI4d8pV omG0RYJw3yo/XPn4f32Qoz9cnETrvo9s26CwqQ5B39U/7xRG7kXJ/ufjDEP6Q1+mU/5XvQ NSI0wYc+vSg4mi9eE1il1vrL1IJa7wnElBcDIA04ORXej0szfmXHuv7I7FWAdL0U5FuxzH VZTtTYjqj2M+xmYBo6zwLecsaZ+PETN9dC5WoIrDbvXyJemzLj24Ww/37zxS+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 847D91DB13 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: lC0+7WMGA4cx Hi, (Sorry for the late reply=E2=80=A6) Andrew Tropin skribis: > Ludovic Court=C3=A8s writes: [...] >>>> Possible action: >>>> >>>> 1. Change config records to accept file-like objects instead of >>>> strings. That way, users can choose to have snippets inlined (in= a >>>> =E2=80=98plain-file=E2=80=99 object) or separate (via =E2=80=98lo= cal-file=E2=80=99). See for >>>> example how =E2=80=98tor-configuration->torrc=E2=80=99 does it. >>> >>> Yeah, there is a =E2=80=98slurp-file-gexp=E2=80=99 procedure that let= =E2=80=99s one read an >>> extenal file, but using existing APIs like =E2=80=98local-file=E2=80=99= is probably a >>> better idea. >> >> Yes, it feels more natural. Also, =E2=80=98slurp-file-gexp=E2=80=99 ret= urns a gexp (a >> code snippet), but as a user you don=E2=80=99t know where that snippet i= s going >> to be inserted; it may not work in some contexts. > > Acually, the idea behind `slurp-file-gexp` is that you always know where > it will be inserted, because it will be inside the specific section of > the configuration. Take a look at emacs home-service example: > https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home-services/emacs.scm= #L91 What I mean is that, in a general sense, one cannot know whether the gexp will be inserted in a place where it=E2=80=99s =E2=80=9Cvalid=E2=80=9D= . Consider the following examples, where the gexp is meant to be inserted in lieu of =E2=80=9CPLACEHOLDER=E2=80=9D: #~(list '(#$PLACEHOLDER)) ;it=E2=80=99s quoted #~(let ((call-with-input-file (const #f))) #$PLACEHOLDER) These are =E2=80=9Chygiene=E2=80=9D problems discussed in the =E2=80=9CCode= Staging in GNU=C2=A0Guix=E2=80=9D paper. All this to say that, from an API viewpoint, I think it=E2=80=99s (1) more robust, as I wrote, and (2) clearer to expect file-like objects in such places. It=E2=80=99s clearer because users can be expected to have an understanding of what =E2=80=98local-file=E2=80=99 does, whereas =E2=80=98s= lurp-file-gexp=E2=80=99 is more involved. I hope this clarifies what I had in mind! Ludo=E2=80=99.