From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iWuZBVoCgGCLtAAAgWs5BA (envelope-from ) for ; Wed, 21 Apr 2021 12:45:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KJMXAFoCgGCqDAAA1q6Kng (envelope-from ) for ; Wed, 21 Apr 2021 10:45:46 +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 B90E812F03 for ; Wed, 21 Apr 2021 12:45:45 +0200 (CEST) Received: from localhost ([::1]:51386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZAMa-00026w-VH for larch@yhetil.org; Wed, 21 Apr 2021 06:45:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZAMR-00026m-3a for guix-devel@gnu.org; Wed, 21 Apr 2021 06:45:35 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:46514 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZAMM-0006tA-I7 for guix-devel@gnu.org; Wed, 21 Apr 2021 06:45:34 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1619001922; bh=h9BjquoCXxEPsEWHFAPVHcEnNczlXXmIEqi2/3WvvlA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=E5ba1MRiG+VmBeQeHkBi7F+rvpe8DGrBF6pTsqfObevUxKMotx1lg4yLEJtXQRtOm U/YWNjENSU3VGA1k/e0+DP6GoGcKAq0z4s6f7QPKbveTnM7v8/ulIBkeS2Y5/B3CFF k78RjgdtSwh7UAyaZq7qM79o5cOshFSaiL+Ax7O4= To: Maxim Cournoyer Subject: Re: Best practices for writing services In-Reply-To: <87wnswcmxi.fsf@gmail.com> References: <878s6kqydj.fsf@yoctocell.xyz> <87wnswcmxi.fsf@gmail.com> Date: Wed, 21 Apr 2021 12:45:21 +0200 Message-ID: <87k0ov7w72.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.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, FROM_SUSPICIOUS_NTLD=0.224, PDS_OTHER_BAD_TLD=2, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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@gnu.org 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=1619001945; 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=wtkLHIIwt/qvhl2PS/Hs19xaJoDh4zDOC66aAYV11X8=; b=HH9bEvWdl9MFvEaMwYRessxPjhiLhAIbPuxow9umf1eMU+5ol3vLKf+00Dg+EqRf3HMIuL 8+zlI4GTe0iPn0kEziA6zYZQ29Jkj4K30ZdOeqhcPqUG6wsiCKnYpWOHtNaLaD3Kb7U+/c KgyT64VvaxQv19HB+uPLOocKU5ms5Zh45OohB4GG1hQ3QH9FAyYMit8Rvn9g5OVe4YUofa fzJsR77PnJdw2Dta5GDmMD5R9LttcBvRmATmu6Sgjkf01T/D6khPUWBZ20Tg7sGLMMiVV3 EUb4Dh9CpyRV4peShNufAi4xhYCQi3YLzBXtsT8Y0zN6gl/m6TDOQ/dfkm9Y0g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619001945; a=rsa-sha256; cv=none; b=Dcs1Nu2V6NYmI07eCYpyEqh4zm3ORySwo+EuY8t4cQVnp8xAp5/cxWc5+RbkoejF9xdQlJ YlQLEbLlkcd4owsucndc1e0P12KAt5WWhAorGNq7bKc02zlLS+/iutS0+FrTYttKcpFXRe FQ8hudL6BhTRZty48M7BjmATPTYFqjLxbl0wDpzTD3Pw/fe1Y3iFaWq9YXykxSuANljoiz cC08yKZijYMiflrYKnFzsYfbJWepqJKSf3I96lvYkAcv3QLCGJGEC151WzmMhCwuAMvvaG AOW37Haz4G5sm9KSHdA4lEstkNMEOBig9Zuko5iuuW9Cwr6r1dKQI9AoJTocDw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=yoctocell.xyz header.s=mail header.b=E5ba1MRi; 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: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=yoctocell.xyz header.s=mail header.b=E5ba1MRi; dmarc=pass (policy=none) header.from=yoctocell.xyz; 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: B90E812F03 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7mXCLTNMYcqn Hi, On Tue, Apr 20 2021, Maxim Cournoyer wrote: > That's a very good question, which I asked myself recently when > attempting to write my first non-trivial service for Guix > (jami-daemon-service-type). I'd say 'define-configuration' is > technically superior because of the automatic type checking it provides. > It's also neat to be able to define the doc at one place and > auto-generate it (although that's still manual for now). You mean that one has to manually evaluate the =E2=80=98generate-documentat= ion=E2=80=99 sexp and paste the output of it in the manual? I thought it would automatically update the manual when running =E2=80=98make=E2=80=99. ;) > It has definitely been collecting some dust compared to the simpler > approach using 'define-record-type*' directly, and the doc output it > can generate doesn't match what is currently the norm in the manual, > so it'd need a bit of a refresh. Yeah, I noticed that some sections in the manual looked a bit different than the rest. One thing that I find a little annoying is that you have to specify a default value for the fields. This doesn=E2=80=99t make much sense in some cases, e.g. there is no good default value for =E2=80=98user.name =3D NAME= =E2=80=99 in the Git config, the user should have to specify that themselves. Another thing is that I don=E2=80=99t always want to =E2=80=9Cserialize-=E2= =80=9D the value for a field, so I sometimes end up defining a bunch of dummy serializers that just return an empty string.