guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extensible G-Expressions


From: Ludovic Courtès
Subject: Extensible G-Expressions
Date: Tue, 17 Mar 2015 22:40:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]