From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kOqxBf6L22VpzQAA62LTzQ:P1 (envelope-from ) for ; Sun, 25 Feb 2024 19:50:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kOqxBf6L22VpzQAA62LTzQ (envelope-from ) for ; Sun, 25 Feb 2024 19:50:38 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=illucid.net header.s=fm3 header.b=d42UhSf7; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=ABUuXY2g; 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=reject) header.from=illucid.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708887038; 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=BdE0GG2rrSi8dQNlbKpOkZAsrjlRRviZ2CeBbIGBP/8=; b=mYCbKaZkre5K3maoFuhZwURpJCnx5lkRbVZ5H7vMCmin4k2ua18f4lqW4I7V0W5QkGFOK9 4hJx2/18Ij3y2ggFud+0ZfbfIh/08+syRUZUY+NBJGy2Oyt/I4hlM0++kFW4K9SkBfx5uV HN+5aYAsBFgNkqoA6VrIrunWY5dLCZ/Mm7UPz3Xsj8GhZIaFVAzaaIZd2UW/UHPZfDsRis rlbpJ9r+CC3SNjBeEI0wziQBJOymuQ8vqAg1BNv8Ij5IMgiDOqQvhm8sLOMyYr8WymZBQr RsZ6oc8x05x/PyVQeHniSb65HFgiHtc5PQtdYNvVdV71p+13ZNLqbPdyAJvNiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=illucid.net header.s=fm3 header.b=d42UhSf7; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=ABUuXY2g; 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=reject) header.from=illucid.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708887038; a=rsa-sha256; cv=none; b=D4tX+X0+QcpZfN+LqSRkcWgiPIOFnyuxfd0ifblqM/WZngBUQl+6cluZiDoo20hJvWqVxd NSDRIsl7EPERGflEVKHntmWLxCxknFswfgAlNitIQG7bVy7BkNT05cWTaaAkoTJUSsXlmy VqzYiQVsG92GS5pKf5g1D00a2gaLW46L6ZZf/uWu6//lNngN7XTqvqMjabYa3lheKZrm0v bTaoiz9cBSSRG2nsS7kSlqA7IELogvAJmQzxD1iRit+CIJ9hxiQiHE2p6HPTEmGtPy9rck U0mr2kbzfOEJ253TGDdcTVv+jzRHRsHH4KVM8ffBpXE4Wonne3ws3tvrRv3Fkw== 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 3B9237E6BC for ; Sun, 25 Feb 2024 19:50:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reJZg-0001Mc-Qw; Sun, 25 Feb 2024 13:50:08 -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 1reJZe-0001MO-TC for guix-devel@gnu.org; Sun, 25 Feb 2024 13:50:06 -0500 Received: from wfhigh6-smtp.messagingengine.com ([64.147.123.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reJZd-0001uR-2q for guix-devel@gnu.org; Sun, 25 Feb 2024 13:50:06 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 76573180008A; Sun, 25 Feb 2024 13:50:01 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Sun, 25 Feb 2024 13:50:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illucid.net; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1708887000; x=1708973400; bh=BdE0GG2rrS i8dQNlbKpOkZAsrjlRRviZ2CeBbIGBP/8=; b=d42UhSf7z3z5YjyFhaGTZXVUad 1H6Oe1EpGJNFgBaFriuIdw+VI7HfPJ1oeEe6qEF5VEinJ8f5S/YKd2FEh6IdpbfU HO0jy/AwdVpfAWqPElfgGbW4+HKHv19jcW2WGRN8DdDLJaFtkxZQ0ILZ4GjOyFOd dfVeNCMItot4kPv+VPl3Pp3TfLffsWFQorRrWPqRyi1lkFbXMO+ru/KjbK/aoFrL tKklftfmb3tD7kDBVfinxzVmuKBYBnRnOaAQ2BvED3eyKdaDLyYGGVXyAFBsidxM aMbnteGxzpLpXP5WrIJAyzqKEP2twlB+3ei+8UTJgyPdi2zpeSOxWPCq0hiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1708887000; x=1708973400; bh=BdE0GG2rrSi8dQNlbKpOkZAsrjlR RviZ2CeBbIGBP/8=; b=ABUuXY2gmU3LA+unR7Gyi0hx/G1nNmzZOug8VdFEmscN S4slsGkXyf4/GGO2FBdr/0dUDiIab1bcYU61D4+1u+f0L0DNmtMrlrchfpCpw8rk s80yYbnAjmhvNNb1ggB1KwNFTf+p7uEp2aDvdbmxRYq7G2q9t9Z/m/CbnNZCIt2k XVZeF+jf0OcZ156BhxGt2af68Q2gqYiwFubO5DZYiJWqdYPOTDWsgz8QpnFAnS+G uzUae/9p2Zu/5Mt4PieRH8hCwlGs8XtXjyUY/rmTpFPEF99t8vXMhZdrkQP57cwn hpcrlecBR5HXWqwPYTeDxkv2RfNKPNijrkuI1vpE6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgedtgdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomheprghnthhl vghrshcuoegrnhhtlhgvrhhssehilhhluhgtihgurdhnvghtqeenucggtffrrghtthgvrh hnpeevudegheeivdfhgedtvdekgfehiefhleeufeefueeiudeuudffkefffedvvdfhieen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhhtlh gvrhhssehilhhluhgtihgurdhnvght X-ME-Proxy: Feedback-ID: i7f19465a:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id AF87436A0076; Sun, 25 Feb 2024 13:50:00 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-153-g7e3bb84806-fm-20240215.007-g7e3bb848 MIME-Version: 1.0 Message-Id: <1ab54235-ecfe-43df-afce-e45ca6aba1c1@app.fastmail.com> In-Reply-To: <748f644460181e086c694333a1faa2c730452a99.camel@gmail.com> References: <1a7168a5-5207-4dfa-ac12-b3fed841580b@app.fastmail.com> <748f644460181e086c694333a1faa2c730452a99.camel@gmail.com> Date: Sun, 25 Feb 2024 10:49:19 -0800 From: antlers To: "Liliana Marie Prikler" , guix-devel@gnu.org Subject: Re: A friendlier API for operating-system declarations Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.157; envelope-from=antlers@illucid.net; helo=wfhigh6-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.12 X-Spam-Score: -5.12 X-Migadu-Queue-Id: 3B9237E6BC X-TUID: 200W01dyFNXr > That looks like a nice syntax indeed. Is the code behind it small > enough to include it in (guix records)? Small enough? Yes (<100 LOC, inc. a handful of comments and tests). Suitable? No, I introduced it as "moderately-cursed" for a reason >u< But I appreciate the sentiment c: 1.) It leaks `(guix records)`'s thunked/delayed field abstraction to the end-user, which will confuse and regularly bite absolutely anyone who tries to use it. 2.) Ideally we'd check that modified fields exist at compile-time. This could require users to provide the record-type, which is not always public, but could also be optional. 3) The `cut`-like transformation is recursive and, while it has well-defined and tested behavior, the semantics are non-standard. I don't believe that the syntax achieves its goals without this mechanism, but there are remaining sub-concerns to address before I'd consider it ready to formalize and document. 4) The syntax expands modifications of multiple fields into recursive expansions (ie: calls to the record constructor) when it would be more efficient (especially for thunked/delayed fields) to accumulate transformations by target field and `compose' them over a single call to the record constructor. This hasn't been an issue in practice, but would be the "right thing to do". #3 and #4 are a light refactoring and feedback-round away (#3 could be controversial), but #1 and #2 require deeper understanding and (especially for #1) modification of `(guix records)' than I'm comfortable with at the moment. If I do raise the possibility of up-streaming it would be with these issues addressed, and would still have substantial cause to warrant discretionary discussion then. Really a scratching-my-own-itch solution atm.