all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Andreas Enge <andreas@enge.fr>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Some macros to make package definitions prettier
Date: Wed, 25 Feb 2015 15:24:19 -0500	[thread overview]
Message-ID: <CAJ=Rwfbdavcd0qbAQQOPd=xbHpJe=pGkU5pBpBvaCygsj_hoWQ@mail.gmail.com> (raw)
In-Reply-To: <20150225181217.GB6653@debian.math.u-bordeaux1.fr>

On Wed, Feb 25, 2015 at 1:12 PM, Andreas Enge <andreas@enge.fr> wrote:
>
> On Wed, Feb 25, 2015 at 05:42:23PM +0100, Taylan Ulrich Bayırlı/Kammer wrote:
>>   (delete foo)
>>   (replace bar 'x)
>>   (add-before baz pre-baz 'y)) ;=> ((bar . x) (pre-baz . y) (baz . 2))
>> This has the following advantages:
>> - The order in which the phases are modified is top-down, where in our
>>   current style it's bottom-up which both distracts (IMO), and one may
>>   forget, as the chain grows and one forgets that it's indeed just a
>>   chain of function calls like (foo (bar (baz x))).
>> - Indentation doesn't keep growing as one adds more modifications.
>
> Actually, I do not like the imperative, non-functional style of these
> syntax rules. For me, they rather obscure what is happening.

It's still functional.  Should we not use 'cond' because it obscures
the series of nested 'if' expressions that it truly is?

> The indentation is just a question of style; in my first recipes, I did not
> indent consecutive modifications of phases, which was just as readable,
> I think (but this only works if you indent manually, and people disliked
> the unorthodox (non-)indentation).

Yeah, I'm not too into manual indenting to make a nested form look linear.

> The general drawback of such syntax rules is that newcomers do not see all
> the inner cogwheels of the system. So on one hand, one gains that contributing
> packages becomes easier; on the other hand, understanding what is actually
> happening becomes harder, and also learning scheme through guix becomes more
> difficult as we move to our own domain specific language.

It's a balancing act.  We can certainly go overboard with macros.
However, I think it's important to build up our packaging language to
be more expressive and declarative.  So, a macro to hide the nested
alist consing that we do constantly is appealing to me.

My 2 cents,

- Dave

  parent reply	other threads:[~2015-02-25 20:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 16:42 Some macros to make package definitions prettier Taylan Ulrich Bayırlı/Kammer
2015-02-25 17:04 ` Thompson, David
2015-02-25 17:06   ` Thompson, David
2015-02-25 19:27     ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 20:54   ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 18:12 ` Andreas Enge
2015-02-25 19:46   ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 20:24   ` Thompson, David [this message]
2015-02-25 23:32 ` Ludovic Courtès
2015-02-26 11:07   ` Taylan Ulrich Bayırlı/Kammer
2015-02-26 21:39     ` Ludovic Courtès
2015-03-03 16:49       ` Taylan Ulrich Bayırlı/Kammer
2015-03-03 20:44         ` Ludovic Courtès
2015-03-03 22:47           ` Taylan Ulrich Bayırlı/Kammer
2015-03-04  9:52             ` Ludovic Courtès
2015-02-26 21:41     ` Ludovic Courtès

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='CAJ=Rwfbdavcd0qbAQQOPd=xbHpJe=pGkU5pBpBvaCygsj_hoWQ@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    /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.