From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: Re: Composing service definitions (and maybe fmt) Date: Tue, 19 Jan 2016 07:58:30 -0800 Message-ID: <87fuxt5zh9.fsf@dustycloud.org> References: <87oacloy61.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYk5-0005zi-Ex for guix-devel@gnu.org; Tue, 19 Jan 2016 11:02:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLYk0-0007UT-ON for guix-devel@gnu.org; Tue, 19 Jan 2016 11:02:49 -0500 Received: from dustycloud.org ([50.116.34.160]:45942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYk0-0007UN-Jw for guix-devel@gnu.org; Tue, 19 Jan 2016 11:02:44 -0500 In-reply-to: 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus writes: > Christopher Allan Webber writes: > >> (I've also thought that some sort of string reader similar to skribe's >> [foo ,(bar)] string-quasiquoting may make things easier. Might even b= e >> complimentary...) > > I like this idea. It seems unrealistic to me to have configuration fil= e > writers for each of the many ideosyncatic configuration file formats. You're probably right. It would be a lot of work to write that many writers, and a lot to ingest every time. > I also don=E2=80=99t enjoy having to concatenate strings to generate > configuration files and I think that it would be useful if we had > string-quasiquoting. Yes, I think so. It brings a lot of the advantages of other string templating system without having some massively lossy DSl. > But I think we need some example cases first. My experiences is > coloured by concatenating strings for udev rules. That=E2=80=99s not n= ice, but > I also would not want to have to learn a new Schemey way of expressing > these rules =E2=80=94 especially when I just want to copy them with min= imal > changes from documentation and don=E2=80=99t want to have to understand= them > first. I agree that learning a bunch of writer functions for expressing rules would *usually* just be too much to learn. So maybe fmt is total overkill. (You can build lesser string generator functions yourself that can be combined together anyhow, even if they aren't quite as combinator'y.) Though I think skribe-style string quasiquoting is not hard for a schemer to learn. I picked it up almost immediately. And it's a lot cleaner than the jinja2 style string templating I've grown accustomed to from python web/deployment land.