|
|
|
|
|
by jancsika
3116 days ago
|
|
> Hackable. It provides Guile Scheme APIs, including high-level embedded domain-specific languages (EDSLs) to define packages and whole-system configurations. What is the benefit of directly using Scheme for the package declarations over using NixOS's DSL? Specifically, what technical features does Scheme make possible which are not possible in NixOS? |
|
Integration of all stages. We use the same language on the build side as on the host side; the same language to execute builds as to define packages. In Guix there is no mix of languages, so we don't need to glue strings together produce build-side shell scripts. Instead we can use higher-level S-expressions and code staging.
For more on code staging see this paper:
This allows for code reuse, even across projects, e.g. the GNU Shepherd init system can take the container code from Guix and run services in isolated environments with very little effort. See this blog post for details: FWIW, Guix implements a DSL that's embedded in Scheme (it's not just "raw" Scheme). The advantage of embedding is tooling: you can work with package definitions right there in the REPL / with Emacs+Geiser; you can use the Guile debugger features.Another result is that all these package definitions form a lazy graph of live Scheme values. In Nix you have a large hash table of identifiers to functions. Think code vs data. In Guix the primary data structure is an emergent lazy graph; it is not merely an inert description of such a graph. Each package definition is just another Scheme value.