GNU Guix: Dissecting Guix, Part 3: G-Expressions
Welcome back to Dissecting Guix!
Last time, we discussed monads, the functional programming idiom used by Guix to thread a store connection through a series of store-related operations.
Today, we'll be talking about a concept rather more specific to Guix: g-expressions. Being an implementation of the Scheme language, Guile is built around s-expressions, which can represent, as the saying goes, code as data, thanks to the simple structure of Scheme forms.
As Guix's package recipes are written in Scheme, it naturally needs some way to represent code that is to be run only when the package is built. Additionally, there needs to be some way to reference dependencies and retrieve output paths; otherwise, you wouldn't be able to, for instance, create a phase to install a file in the output directory.
So, how do we implement this "deferred" code? Well, initially Guix used plain old s-expressions for this purpose.