all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Sergey Trofimov <sarg@sarg.org.ru>, guix-devel@gnu.org
Subject: Re: Are declarative app configs worth it?
Date: Tue, 26 Dec 2023 15:39:40 +0000	[thread overview]
Message-ID: <viSBLH0J55ZJnZEEkLOQQ26MgVrjAmKw-gT5RN2Mb9hiZB9Isxo0DpE874RNziz_AkglJs8GZoUddAPXHAizr9uHfWT7Ecv6VppX825q8tg=@lendvai.name> (raw)
In-Reply-To: <87h6k5ko0g.fsf@elephly.net>

> > - adding it to guix increases maintenance burden: new versions could
> > add or remove config options
> 
> 
> This is why there should be automated tests. There are too few of them.


early detection of the breakage is just one part of the story. then it also needs to be fixed -- before dropping the hammer and abandoing the worksite.

writing and maintaining the tests have a cost, too.


> > - it requires documentation/translation, another hidden cost
> 
> 
> We should only accept configuration procedures that have proper
> documentation, yes.


in this context i recommed:

What is Seen and What is Not Seen
by Bastiat

https://oll.libertyfund.org/page/wswns

or specifically:

"In the sphere of economics an action, a habit, an institution or a law engenders not just one effect but a series of effects. Of these effects only the first is immediate; it is revealed simultaneously with its cause, it is seen. The others merely occur successively, they are not seen;3 we are lucky if we foresee them."

if you demand that e.g. all services accepted into guix have a configuration entry for every possible config field, and that the documentation of these fields are duplicated into the guix codebase... then whatever is included into guix will have a 100% coverage. this is what is seen.

but what about the lost potential? because i can guarantee you that while you'll get 100% coverage, you'll also only get a fraction of the total number services and fields.

which one will yield a better guix experience?

what i'm doing with my own services, and what i also recommend, is to always have an 'extra-arguments or 'extra-fields that allows defining any config value, and serializes it as-is. that way the user can rely on the documentation of the daemon, and blindly apply it while writing the guix config.

and only reify those couple of config fields into scheme code that can provide something useful beyond merely serializing the value as-is.

this way:
 - the guix codebase remains smaller (OAOO principle)
 - updating the app's package in guix is simpler
 - guaranteed not to get out of sync with the app
 - smaller threshold for new contributions
 - which translates to more supported services

i find the free-form module type, as suggested by John Soo above, to be a good idea. so much so that i may even look into writing a prototype and try to use it to replace my two inline shepherd-service instances.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“War is a ritual, a deadly ritual, not the result of aggressive self-assertion, but of self-transcending identification. Without loyalty to tribe, church, flag or ideal, there would be no wars.”
	— Arthur Koestler (1905–1983)



  parent reply	other threads:[~2023-12-26 15:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 13:53 Are declarative app configs worth it? Sergey Trofimov
2023-12-26 14:56 ` Ricardo Wurmus
2023-12-26 15:05   ` John Soo
2023-12-26 15:18   ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-12-26 16:50     ` Ricardo Wurmus
2023-12-27  1:34       ` Nguyễn Gia Phong via Development of GNU Guix and the GNU System distribution.
2023-12-26 15:39   ` Attila Lendvai [this message]
2023-12-26 16:49     ` Ricardo Wurmus
2023-12-27  7:38   ` Sergey Trofimov
2023-12-28 14:28     ` Efraim Flashner
2023-12-27  4:15 ` Murad Mamedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='viSBLH0J55ZJnZEEkLOQQ26MgVrjAmKw-gT5RN2Mb9hiZB9Isxo0DpE874RNziz_AkglJs8GZoUddAPXHAizr9uHfWT7Ecv6VppX825q8tg=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    --cc=sarg@sarg.org.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.