From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KP0oFotRe2MmCwEAbAwnHQ (envelope-from ) for ; Mon, 21 Nov 2022 11:23:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id INUhFotRe2MXcQAA9RJhRA (envelope-from ) for ; Mon, 21 Nov 2022 11:23:07 +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 F31A81C39E for ; Mon, 21 Nov 2022 11:23:06 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox3wd-0005P1-EU; Mon, 21 Nov 2022 05:22:31 -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 1ox3wb-0005Op-SS for guix-devel@gnu.org; Mon, 21 Nov 2022 05:22:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox3wb-0002Hz-JX; Mon, 21 Nov 2022 05:22:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=5R48ZtXOiBdOO0uQNn2BScXhzb/AHMzThjiF9td1Fno=; b=go5pybD+ESqLjbLzqDm5 gmOv2ymha8j1+tc5+cY+K1q/IMaOCHuUTtD1RXKu2SyGJHwNsH/6iqUxgJGgajCn1GXeIV1C436Yx eez/+NEfpqneu7QJ8ONsM7DO8aot+EEALcsp3VMq+jzrF1FESa9CgBZZrap4QwptWDgbOQj0Mp0Wo Or+WMqGFf/EiwMVTH9qhay/x/0KTGddGzjZm2QjZgJ2S1qFdsCZ2atgCakxf/wfobgSTv8vVHKDnp v0GdL/NLgHpQkwfo1U8hYEejhEX7Pdhjb38sQ5q6M1LbJig+lpjV67RtxS3G/8ZMRKucxIRLXYIUO CiYlzK2aa9eR+Q==; Received: from [193.50.110.147] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox3wZ-0002Oo-VW; Mon, 21 Nov 2022 05:22:29 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Cc: guix-devel@gnu.org Subject: Re: Layout of =?utf-8?Q?=E2=80=98define-configuration=E2=80=99?= records References: <20221029034716.11125-1-maxim.cournoyer@gmail.com> <20221029041649.12144-1-maxim.cournoyer@gmail.com> <87zgcpdx6q.fsf_-_@gnu.org> <8735ag43ga.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Primidi 1 Frimaire an 231 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la Raiponce 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: Mon, 21 Nov 2022 11:22:25 +0100 In-Reply-To: <8735ag43ga.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 18 Nov 2022 11:44:53 -0500") Message-ID: <87zgckli8u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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.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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669026187; 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:dkim-signature; bh=5R48ZtXOiBdOO0uQNn2BScXhzb/AHMzThjiF9td1Fno=; b=lyGjtKKiDI4kSnYVxpxhXF7Ow/iUb4Rv4zywEqiZhsPe8H6ZfRcA+oKzBD11fuE1Ij47+5 K7VGD8cdAK8NCqW9/k0CJNAg8TN4qYsAK7FZmIy6JUdZ+LuNq21dYamHidvEUg+d9F4ICv YP74jCC8x9XG0F8QLOUccGQWdOUFcQYQcU1WAueA1ArNpYFkdA1nZyNvraZFtgZYsAVJxC s6Z7EAA1GS/FuCd6qm6d2s/EWOHL8wVjZsu+plnj/2jtTBpsWb6vDwBx4DfccyZCwobcp0 fTQSDDKPVLSlo/OOFWKA5Ztjfy1q16Nolcyp8lorbiYZDDMLQ24MPlEcqRdgIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669026187; a=rsa-sha256; cv=none; b=fJkTFBiyYJDqgJ98Z4GEDFXg4j7sgmbW89qU2eAJ1X2dce/0RFYfd/ZHMUGBJvrAJnUo0S zrB2bbV1yys881DvWVLErBMEAhKPb5uvUZzMRJBUz+KojdOtkzxeMUVOPB0APvoBgOD0DR i/hi/uOxXYooSJjd8HgH+d9YXGRqAuBhkYuUJSbdNbxa4Uh1x7tzIRLxlOLb10WiKmQl+q Gl+QWU0XPdooQBb3orhZ5w/2aTwZLfUFqass4a3scFecgRYrsD2FliC1uXFW6qbPytWuRv l3DJ/WRFkngFFpFVdDc+Lq2O9K2ZNC9GjMHC5ch/nvG0X562+ZLqXWokLAk3wA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=go5pybD+; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -5.21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=go5pybD+; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: F31A81C39E X-Spam-Score: -5.21 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8JnVmi8sD0g7 Hi Maxim, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >>> + (%location #,(id #'stem #'stem #'-location) >>> + (default (and=3D> (current-source-location) >>> + source-properties->location)) >>> + (innate))) >> >> Moving the field last is problematic as we=E2=80=99ve seen for any user = that >> uses =E2=80=98match=E2=80=99 on records=E2=80=94something that=E2=80=99s= not recommended but still used >> a lot. > > Yep. I had that on mind when I made the change, though I still missed a > few occurrences. [...] > I wanted match on define-configuration'd fields to be > backward-compatible with fields migrated from define-record-type*, so > that they such change can be made without worrying breakages. That had the opposite effect: it introduced breakage precisely because existing uses of =E2=80=98match=E2=80=99 on records need to be verified man= ually, one by one. That led me to improve =E2=80=98match-record=E2=80=99, to recommend it in t= he manual, and do =E2=80=9Cconvert=E2=80=9D some uses of =E2=80=98match=E2=80=99 to = =E2=80=98match-record=E2=80=99: https://issues.guix.gnu.org/59390 That=E2=80=99s a good outcome, but I=E2=80=99d prefer not feeling this kind= of pressure. > I initially got tricked by that discrepancy and it took me quite some > time hunting down a cryptic backtrace when authoring the new mcron > configuration records. I see. However, this is a wide-ranging change, so I think this should have been discussed separately from the mcron changes. I find it important to take time for review and discussion for such changes. >> One last thing: placing =E2=80=98%location=E2=80=99 first can let us imp= lement: >> >> (define (configuration-location config) >> (struct-ref config 0)) > > Would this have worked? > > scheme@(gnu services mcron)> (define config (mcron-configuration)) > scheme@(gnu services mcron)> (struct-ref 0 config) You got the order wrong. :-) > All in all, I think that's a rather small change that got our internal > implementation of both type of records in sync between > define-configuration and define-record-type*, that should pave the way > for migrating more of the later to the former without risking breaking > something, going forward. Fundamentally, the layout of record types should not be visible to users. That it is visible via =E2=80=98match=E2=80=99 is the problem, and = the solution is not to tweak record type layout but instead tp make sure =E2=80=98match= =E2=80=99 uses on records vanish. I hope that makes sense! > scheme@(gnu services mcron)> ,use (oop goops) Speaking of which: there was a conscious decision to not use GOOPS in Guix from day one. Perhaps some day we=E2=80=99ll want to collectively que= stion that, but let=E2=80=99s make sure we don=E2=80=99t add that dependency on a= whim. For example: class-of -> struct-vtable class-name -> record-type-name See commit 50c17ddd9e2983d71c125d89b422fd20fca476e1 for an example. Thanks, Ludo=E2=80=99.