unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guix-devel@gnu.org
Subject: Extensible G-Expressions
Date: Tue, 17 Mar 2015 22:40:51 +0100	[thread overview]
Message-ID: <87619zpajg.fsf@gnu.org> (raw)

Hello!

I just merged the ‘wip-extensible-gexps’ in ‘master’.  This breaks the
ABI, so make sure to run:

  make clean-go && make

Before that, in a gexp like:

  #~(system* #$foo)

‘foo’ had to be either a package, an origin, a derivation, or a
serializable Scheme object such as a string or number.

Now the gexp mechanism is extensible: it’s possible to define
“compilers” for new types high-level objects.  A compiler is a procedure
that compiles the high-level object to a derivation.

There’s a compiler for packages and there’s one for origins, but it’s
possible to define compilers for, say, service configuration objects
such as <nscd-configuration> and whatnot.  This should make it possible
to shift from an explicit style to a more declarative style (the service
procedures could become normal instead of monadic, for instance, with
the “plumbing” hidden in gexp compilers.)

My main motivation for this, though, was to allow (guix packages) itself
to use gexps (for instance in ‘patch-and-repack’), which was not
possible before because (guix gexps) depended on (guix packages).

Comments & bug reports welcome!

Ludo’.

                 reply	other threads:[~2015-03-17 21:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87619zpajg.fsf@gnu.org \
    --to=ludo@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).