From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CFjfLopACmRHdAEASxT56A (envelope-from ) for ; Thu, 09 Mar 2023 21:24:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WLDiLYpACmQK1gAAG6o9tA (envelope-from ) for ; Thu, 09 Mar 2023 21:24:42 +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 4D8A0334EB for ; Thu, 9 Mar 2023 21:24:42 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AROcTksr; 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=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678393482; 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=T0DHxGVbFEcPJL5PqVG20P04X0NxASQ14tl1rJzuPcE=; b=D9H53Oj/UyMdZdnr0r+7G348u/Sv7L8/bfCSYmUd+OMBomH7bkviFbObQlCa2fQL7UNif6 NowZU4CbuMrH/Kn53cgIvRjD7ak/QrUmcyOa5pi/UkHbMOEm2cx77WR2h4o/3m8Dzl7gV2 8NlRmEWGDGC/OqC9J5I7WmXJE1jHxrFslhXPEu+PEzciGh+BAAviP3v0UHmluPQf0lSMTE bJGOHPiYWyWLMpiP6hda3Y0TUJYh5yX9sVpVXWRVXJe4O/VSGtMHo/hymeRPpzTZPKapIr ZZtAWIQAh3wrUej0UxaAx4KCT/A/iS5d/iIzfLweDpRG8OX5j8Q4JtdhDFzuGw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678393482; a=rsa-sha256; cv=none; b=OiNYUPtj0TccwE5c5AA/Y97IXMp4lCvGiMXvWtULijmwA71HMMMF9sI9O84U7YfxY4sHj9 pDHlo1GWEjYv6g8CMmjKad58iU10/4yX9PL/SZph1LkEjfEN+l0LGCBh6HLxkoPGkGajQk kUzkJxdeOhE3HT+5fNUeS6xd6fOAAbLeaIfxRLNnox3E4OUz2HdGHRkUmf8+J4Z5q8XaZL UaaqPo/KBxtFPiVkST9gHXVtP+C46fgZeDCFcVic/lAd5wlcWe7jTH3TMbtNheO6x6CTr4 f/oOuuxwpEu2rx3U4PAbV28k1cCL1Dvxbo6S6iYagxogybU1E+iGi7YKjqUV7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AROcTksr; 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=none) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paMnh-0007Vf-An; Thu, 09 Mar 2023 15:23:46 -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 1paMnQ-0007SO-43 for guix-devel@gnu.org; Thu, 09 Mar 2023 15:23:31 -0500 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paMnM-00046z-V5; Thu, 09 Mar 2023 15:23:27 -0500 Received: by mail-ed1-x541.google.com with SMTP id ay14so11841771edb.11; Thu, 09 Mar 2023 12:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678393402; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=T0DHxGVbFEcPJL5PqVG20P04X0NxASQ14tl1rJzuPcE=; b=AROcTksriXcfH4+7/cs3wcc1xiyWZe8/ICCZHq3flFMgjzPjwCl1H888kEguhwvASA vTZjFiVi1H+uEzsfWw0E12F+n5JFlyb2Xqq4vUPXP6VezpkQmYx91VCweNCWypVLO78m yf0rQINn0cyoI8ENvKLWRt4iJYehOO5DQYI0uNCyx6qVe5fLu9miTlbnwJ4A0ZYuVGTX M/SP9KTCirxtZFXF7d3lbDtT+VEx+5ruJh87tW3Twq2oXYKTERVTAOq/AXZ9DkGQjBXe cFZyWVU3/AmDNmoIoygS8dvBx+rCih1oepNoDdeDai0oUYmK97Z+sC7Hu4xP9mxhj8y6 5ENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678393402; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=T0DHxGVbFEcPJL5PqVG20P04X0NxASQ14tl1rJzuPcE=; b=mv63BxALaDYK3AKc1NMEJOcuOEHMfA5UAp2C9o9u8axEebgfpPOMVBeHrb4FQkDY5E iNdGLuGT2oy6y8gAWnEH9vTpV3P9MNcXTcN9ft2q5jlLtmtA9M0LLzLh5SeWoR92myhw 1s7PGMyoLaRv8SlJlUNqdRnzCAUOWC3woPZyhyFLUphnf7jyKReJ6DsPbqVztoHFxRF5 uXDigBH5CiAQ4wxohEZhd0lcm4J4FYYXk4xw/oIlaKTsenDaKFvS40AE7kBkZx2W5SaO kAqMJLoITPMiJrc4zrd+dkEDPCRZ4tuKWYVLHkwwwpSF9v754oSEJ+0856A8OlL82iTb ZdqA== X-Gm-Message-State: AO0yUKX+KMxx05iKCWaipQJ+Grli1hksQZzUh2oSI2DdZ7WUCYcSZIuR 9PQDfRji7k9KUOA631lAp+c= X-Google-Smtp-Source: AK7set+HZYb6LEk2wwSMi1boV8qRmc+GmOj/5Pmdip7DPY0d9tLuBlggbsI4FwmF0NJmaQUnMeJVvQ== X-Received: by 2002:a50:ee8c:0:b0:4ac:b32d:3dab with SMTP id f12-20020a50ee8c000000b004acb32d3dabmr21325891edr.29.1678393401816; Thu, 09 Mar 2023 12:23:21 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id k10-20020a508aca000000b004c09f0ba24dsm155468edk.48.2023.03.09.12.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 12:23:21 -0800 (PST) Message-ID: Subject: Re: Brainstorming ideas for define-configuration From: Liliana Marie Prikler To: Bruno Victal , guix-devel Cc: Felix Lechner , Maxim Cournoyer , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Thu, 09 Mar 2023 21:23:19 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::541; envelope-from=liliana.prikler@gmail.com; helo=mail-ed1-x541.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: 4D8A0334EB X-Spam-Score: -6.93 X-Migadu-Spam-Score: -6.93 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-TUID: kUtnE/CnK5fU Hi, Am Donnerstag, dem 09.03.2023 um 02:28 +0000 schrieb Bruno Victal: > After spending some time with old and new Guix services, I'd like to > suggest some potential improvements to our define-configuration > macro: >=20 >=20 > User-specified sanitizer support > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > The sanitizers should be integrated with the type. Otherwise, they > are tedious to use and appear verbose when repeatedly applied to > multiple fields. >=20 > --8<---------------cut here---------------start------------->8--- > ;; Suggestion #1 > ;; The procedure could return a sanitized value. Upon failure, there > are > ;; the following options: > ;;=C2=A0=C2=A0=C2=A0 - The procedure returns only a special value (akin t= o %unset- > value) > ;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 and an error message, as a pair. > ;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Exception raising is done by define-sani= tized macro behind > the scenes > ;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 which makes the procedure easier to writ= e. > ;;=C2=A0=C2=A0=C2=A0 - The procedure raises an exception. There would be = no > consistency > ;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 on the message formats, however, except = for any agreed > convention. > ;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This would involve some code duplication= . > ;; Cons: too specific, not extensible. >=20 > (define-sanitized typename procedure > =C2=A0 (prefix ...)) >=20 >=20 > ;; Suggestion #2 > ;; A user-supplied procedure ('procname' below) would work just like > the > ;; procedure in option #1. > ;; There is some similiarity to the Guix record-type*. > ;; This could be extended more easily in the future should it be > required. > (define-type typename=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ; maybe c= all this 'define-configuration- > type' ? > =C2=A0 (sanitizer procname) > =C2=A0 (maybe-type? #t) > =C2=A0 ;; The properties below are service specific. > =C2=A0 ;; If this is implemented with Guix record-type* then we could hav= e > a > =C2=A0 ;; module containing generic types and do something along the line= s > of: > =C2=A0 ;; (define-type foo-ip-address > =C2=A0 ;;=C2=A0=C2=A0=C2=A0 (inherit generic-ip-address) > =C2=A0 ;;=C2=A0=C2=A0=C2=A0 (serializer ...)) > =C2=A0 (serializer procname)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ; define-type/= no-serialization =3D sets > this field to #f ? > =C2=A0 (prefix ...)) > --8<---------------cut here---------------end--------------->8--- Rather than creating yet another syntax, I think we should instead extend define-configuration to support this use-case in a backwards- compatible manner. As for error handling, there are basically two options: 1. Let the sanitizer raise any exception and do regular stack=C2=A0 unwinding. 1b. Provide a source-location to the sanitizer so that it can use it=C2=A0in case of an error to provide better fix hints. 2. Let the sanitizer raise any exception, catch it and enrich it with the source-location. Also possibly cross-check the resulting value so that e.g. #f is not used if it's not a maybe type or a boolean. > The original motivation for this proposal stems from the attempts to > resolve issue #61570. There, one potential fix was to handle the user > and group fields similarly to the way greetd service handles them. > There is some opportunity for generalization here, types that might > be useful elsewhere, such as a port number or a host name, could be > placed in a separate module. I think you are blending several concerns together here, which is fine insofar as sanitizers are powerful enough to mix those but perhaps not the wisest idea from a software engineering perspective. Coercing an account name into a user account is a distinct operation from checking whether an integer is indeed a port =E2=80=93 the latter is a simple range check that can already be performed with the existing framework. > Record Validator > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > There is also a need to validate records. Matching fields alone do > not actually ensure that the configuration is coherent and usable. > For example, some fields may be mutually incompatible with others. I smell bad code ahead. > We could provide procedures that validate each record type within > define-configuration itself instead of validating the value at > runtime (i.e. within the body of the service-type). >=20 > --8<---------------cut here---------------start------------->8--- > ;; the common case > (define-configuration foo-configuration > =C2=A0 (name > =C2=A0=C2=A0 string > =C2=A0=C2=A0 "Lorem ipsum...") >=20 > =C2=A0 ;; ... >=20 > =C2=A0 (validator procname)) >=20 > ;; [bonus] Simpler configurations that only care for mutually- > exclusive fields > (define-configuration foo-configuration > =C2=A0 (name > =C2=A0=C2=A0 string > =C2=A0=C2=A0 "Lorem ipsum...") >=20 > =C2=A0 (title > =C2=A0=C2=A0 string > =C2=A0=C2=A0 "Lorem ipsum..." > =C2=A0=C2=A0 (conflicts 'name))) > --8<---------------cut here---------------end--------------->8--- Instead of providing both a name field and a title field, you might provide a field that can either be a name or a title or allow an even more powerful value type as long as it makes sense. > Comments regarding literal placement > --------------------------------------------------------------------- > ---------- >=20 > Does the placement order matter for the extra fields/literals for > define-configuration? Can they be placed arbitrarily or only at the > bottom? (where custom-serializer is specified) To keep backwards compatibility, I'd use the place where custom- serializer currently lies to add these new customizations, but allow arbitrary order within them. Using only sanitizer and serializer for the sake of simplicity, the following forms would be allowed: - (name type doc): Implicit serializer - (name type doc serializer): Explicit serializer with deprecation warning - (name type doc (serialize serializer)): Explicit serializer, new form - (name type doc (sanitize sanitizer)): Explicit sanitization, implicit serialization - (name type doc (sanitize ...) (serialize ...)): Sanitization and=20 serialization explicit. > Another point, extra parameters given to define-configuration should > never clash with field names. For example, it should be possible to > name a field 'prefix', 'location' or similar without causing issues > like #59423. >=20 >=20 > Coalesced documentation > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Currently, we manually edit the texinfo output from configuration- > >documentation if we're unsatisfied with the generated result. For > instance, substituting @item with an @itemx marker for fields whose > documentation is similar. >=20 > Instead, we could embed hints in define-configuration that affect the > texinfo generation in smarter ways. >=20 > In the long term, guix.texi should source some portions of the > documentation directly from the code base. The current workflow > involving copy and paste the output from the evaluation of > configuration->documentation carries the unnecessary risk that future > documentation patches are done against guix.texi rather than the .scm > file from where it was generated. (issue #60582) >=20 > Snippet based on mympd-ip-acl (gnu/services/audio.scm): > --8<---------------cut here---------------start------------->8--- > (define-configuration/no-serialization mympd-ip-acl > =C2=A0 (allow > =C2=A0=C2=A0 (list-of-string '()) > =C2=A0=C2=A0 "Allowed/Disallowed IP addresses.") >=20 > =C2=A0 (deny > =C2=A0=C2=A0 (list-of-string '()) > =C2=A0=C2=A0 (documentation 'allow)))=C2=A0 ; group with field 'allow >=20 > ;;; --- texi output below --- >=20 > @c %start of fragment > @deftp {Data Type} mympd-ip-acl > Available @code{mympd-ip-acl} fields are: >=20 > @table @asis > @item @code{allow} > @itemx @code{deny} (default: @code{()}) (type: list-of-string) > Allowed/Disallowed IP addresses. >=20 > @end table > @end deftp > @c %end of fragment > --8<---------------cut here---------------end--------------->8--- Sounds good, but you'd have to take extra caution here to not end up in weird situations. Consider for example: (define-configuration micromanaged-acl (allow (list-of-string '()) "Allowed/Disallowed IP addresses.") (ask (list-of-string '()) "IP addresses which are allowed only after manual confirmation.") (deny (list-of-string '()) (documentation 'allow))) ; group with field 'allow > Serializer access to other fields > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Serialization procedures generally only have access to the values of > its own field. That may be insufficient in some cases as whether a > field can be serialized or how that is done, for example, can depend > on the value of other fields. That sounds like a very, very bad idea. Instead of having values that provide no complete information of their own, group them into records. > mympd-service-type is one example where each serialized field depends > on the value of another field. Our standard serializer procedures > were useless for that case. Well, I'd for one send a patch upstream to separate configuration from whatever is going on in the "working directory" =E2=80=93 that pattern's hazardous as fuck already. Other than that, it wouldn't even strictly be necessary to depend on this or rather, you are actually abusing the serialization feature to implement a service type that wasn't meant to be implemented in this manner. > As a side note, the 'this-record' macro does not work with > define-configuration which made it impossible to use > (custom-serializer) for the same effect. >=20 > Instead, serializer procedures could take additional keyword > arguments: > --8<---------------cut here---------------start------------->8--- > (define* (serialize-string field-name value (#:key config)) > =C2=A0=C2=A0 (let ((baz-value (assoc-ref config 'baz))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-append baz-value "/" value) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...)) > --8<---------------cut here---------------end--------------->8--- Note that for the mympd-case you'd have to repeat the same boilerplate over and over, hardly making any improvement over how the service is currently written. > Inheritable record-type definition > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > The openvpn-service pairs in (gnu services vpn) define a special > macro define-split-configuration with the purpose to avoid code > duplication since the service pairs have multiple fields in common. >=20 > Perhaps in a similar vein to SRFI-136, we could have: >=20 > --8<---------------cut here---------------start------------->8--- > (define-configuration openvpn-common-configuration > =C2=A0 (openvpn > =C2=A0=C2=A0=C2=A0 (file-like openvpn) > =C2=A0=C2=A0=C2=A0 "The OpenVPN package.") > =C2=A0 ;; ... > ) >=20 > (define-configuration openvpn-server-configuration openvpn-common- > configuration > =C2=A0 (tls-auth > =C2=A0=C2=A0=C2=A0 (tls-auth-server #f) > =C2=A0=C2=A0=C2=A0 "Add an additional layer of HMAC authentication on top= of the TLS > control > channel to protect against DoS attacks.") > =C2=A0 ;; ... > ) >=20 > ;;; or through a literal/keyword approach >=20 > (define-configuration openvpn-server-configuration > =C2=A0 (tls-auth > =C2=A0=C2=A0=C2=A0 (tls-auth-server #f) > =C2=A0=C2=A0=C2=A0 "Add an additional layer of HMAC authentication on top= of the TLS > control > channel to protect against DoS attacks.") >=20 > =C2=A0 (parent openvpn-common-configuration)) >=20 > --8<---------------cut here---------------end--------------->8--- Note that with the keyword approach you can no longer name fields "parent", which might not be what you intended. > Generic serialize-configuration > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > The procedure serialize-configuration inherently assumes that the > serialized configuration must be a single string. This assumption > needn't always hold, especially if the service in question is not a > shepherd service. >=20 > We could possibly make this procedure a bit more "generic", maybe > picking some ideas from SRFI-171 Transducers. >=20 > Another improvement to this procedure is to eliminate (or make > optional) the second parameter, the configuration fields. It's > unclear what value it brings since one can't use fields from another > configuration type here. An argument can be made for selectively > serializing some of the fields but then it would be more practical to > make this an optional parameter. I think it's fine to assume the most common case and let the users handle their own uncommon beasts. > PS. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Kind of a late realization, but couldn't many of the items above be > satisfied by improvements to define-record-type* instead? Isn't the point that started this the realization that define-record- type* has a feature that's currently inaccessible through define- configuration? =F0=9F=99=82=EF=B8=8F Cheers