[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: website: Add draft of post about Guile 3.
branch master updated: website: Add draft of post about Guile 3.
Tue, 21 Jan 2020 05:11:42 -0500
This is an automated email from the git hooks/post-receive script.
civodul pushed a commit to branch master
in repository guix-artwork.
The following commit(s) were added to refs/heads/master by this push:
new c3f8b3a website: Add draft of post about Guile 3.
c3f8b3a is described below
Author: Ludovic CourtĂ¨s <address@hidden>
AuthorDate: Tue Jan 21 11:11:04 2020 +0100
website: Add draft of post about Guile 3.
* website/drafts/guile-3.md, website/static/blog/img/guile-3.png: New
website/drafts/guile-3.md | 244 ++++++++++++++++++++++++++++++++++++
website/static/blog/img/guile-3.png | Bin 0 -> 18246 bytes
2 files changed, 244 insertions(+)
diff --git a/website/drafts/guile-3.md b/website/drafts/guile-3.md
new file mode 100644
@@ -0,0 +1,244 @@
+title: Guile 3 & Guix
+date: 2020-01-23 14:30
+author: Ludovic CourtĂ¨s
+tags: Scheme API, Programming interfaces
+Version 3.0 of GNUÂ Guile, an implementation of the [Scheme programming
+language](https://schemers.org), [was released just last
+This is a major milestone for Guile, which gets compiler improvements
+and just-in-time (JIT) native code generation, leading to significant
+performance improvements over 2.2. Itâ€™s also great news for all the
+users of Guile, and in particular for Guix!
+![Guile 3 logo.](https://guix.gnu.org/static/blog/img/guile-3.png)
+This post discusses what it means for Guix to migrate to GuileÂ 3 and
+how that migration is already taking place.
+# Guile in Guix
+Most users interact with Guix through its command-line interface, and we
+work hard to make it as approachable as possible. As any user quickly
+notices, Guix uses the Scheme programming language uniformly for its
+anyone who starts packaging software and anyone who starts packaging
+software knows that [package
+are in fact Scheme code as well.
+This is a significant departure from many other, and in particular from
+[Nix](https://nixos.org/nix/). While Nix defines several
+domain-specific languages (DSLs) for these aspectsâ€”the [Nix
+but also specific
+chooses Scheme as the single language for all this, [together with the
+definition of high-level embedded domain-specific languages
+It goes beyond that: in Guix System, all the things traditionally
+implemented in C or as a set of Perl or shell scripts are implemented in
+Scheme. That includes [the init
+[the initial RAM disk
+[system tests](https://guix.gnu.org/blog/2016/guixsd-system-tests/), and
+more. Because this leads to several layers of Scheme code, executed at
+different points in time, Guix includes a [_code staging_
+mechanism](https://hal.inria.fr/hal-01580582/en) built upon the nice
+properties of Scheme.
+Why do that? Our arguments, right from the start, were twofold: using a
+general-purpose language allows us to benefit from its implementation
+tooling, and having interface for â€śeverythingâ€ť in Scheme makes it easy
+for users to navigate their distro or OS code and to reuse code to build
+new features or applications. Guix developers benefit from the ease of
+code reuse every day; demonstrative examples include the [use of Guix
+container facilities in the init
+the development of
+providing facilities around packages, the implementation of additional
+[interfaces](https://github.com/UMCUGenetics/hpcguix-web/), and work on
+applications that use Guix as a library such as the [Guix Workflow
+As for the benefits of the host general-purpose language, these are
+rather obvious: Guix developers benefit from an expressive language, an
+optimizing compiler, a debugger, a powerful [read-eval-print loop
+an [interactive development environment](https://nongnu.org/geiser/),
+and all sorts of libraries. Moving to GuileÂ 3 should add to that better
+performance, essentially for free. To be comprehensive, GuileÂ 3 may
+well come with a set of brand new bugs too, but so far we seem to be
+# Migrating to Guile 3
+What does it mean for Guix to migrate to GuileÂ 3? Weâ€™ve seen above
+different ways in which Guix relies on Guile. In short, we can say that
+migration is threefold:
+ 1. Guix is a distro that ships Guile-related packages. Like any other
+ distro, it will have to upgrade its `guile` package to 3.0 and to
+ ensure packages that depend on it and updated as well.
+ 2. Guix is a program written in Guile. As such, we need to make sure
+ that all its dependencies (half a dozen of Guile libraries) work
+ with GuileÂ 3 and that Guix itself runs fine with GuileÂ 3.
+ 3. Guix ties together operating system components. In particular, the
+ init system (the Shepherd) and other boot-time facilities will also
+## The packages
+Updating the distro is the boring part, but itâ€™s best to get it right.
+Guix makes it possible to have unrelated versions of variants of
+packages in different environments or different profiles, which is very
+nice. Weâ€™ll have performed a smooth transition if users and tools see
+that the packages named `guile` and `guile-ssh` (say) transparently move
+from Guile 2.2 to 3.0, _in lockstep_.
+Put differently, most the upgrade work upon a programming language
+version bump deals with conventions, and in particular package names.
+Currently, `guile` corresponds to the 2.2 stable series and all the
+`guile-*` packages are built against it. In the meantime, the package
+for GuileÂ 3 is named `guile-next` and packages built against it are
+The big switch will consist in renaming all current `guile-*` packages
+to `guile2.2-*` packages, for use with the legacy 2.2 series, and
+renaming all the `guile3.0-*` packages to `guile-*`. We will switch
+soon, but before getting there, weâ€™re making sure important packages are
+available for 3.0.
+A more interesting part is â€śportingâ€ť Guix itself from GuileÂ 2.2 to
+GuileÂ 3. It seems that developers have become wary of 2-to-3
+transitions for programming languages. Fear not! Switching from
+GuileÂ 2 to GuileÂ 3 turned out to be an easy task. In fact, very little
+changed in the language itself; what did changeâ€”e.g., semantics on fine
+points of the module system, support for structured exceptionsâ€”is either
+optional or backwards-compatible.
+As GuileÂ 2.9 pre-releases trickled, we started testing all the Guile
+libraries Guix relies on against 2.9. For the vast majority of them,
+all we had to do was to [update their `configure.ac` to allow builds
+Guix itself was a bit more work, mostly because itâ€™s a rather large code
+base with a picky test suite. The bit that required most work has to do
+with the introduction of [_declarative
+an optional semantic change on modules to support more compiler
+optimizations. We had several [â€śwhite-box
+testsâ€ť](https://en.wikipedia.org/wiki/White-box_testing) where tests
+would happily peek at private module bindings through [the magical-evil
+Because we chose to enable declarative modules, we also had to adjust
+our tests to no longer do that. And well, thatâ€™s about it!
+At that point, we were able to [create a `guile3.0-guix` package
+primarily for testing purposes. Soon after, we told [`guix
+to [build Guix with 3.0 instead of 2.2](XXX). Thus, Guix users who
+upgrade transparently find themselves running Guix on GuileÂ 3.0.
+The main benefit is improved performance. GuileÂ 3 is known to be [up to
+32 times faster than
+on some micro-benchmarks. Assessing the performance gains on a
+â€śreal-worldâ€ť application like Guix is the real test. What would be a
+relevant test? At its core, Guix is essentially a compiler from
+high-level descriptions of packages, operating systems, and the like, to
+low-level build instructions
+Thus, a good benchmark is a command that exercises little more than this
+guix build libreoffice ghc-pandoc guix --dry-run --derivation
+guix system build config.scm --dry-run --derivation
+On x86_64, the `guix build` command above on GuileÂ 3 is 7% faster than
+on GuileÂ 2.2, and `guix system build`, which is more
+computing-intensive, is 10% faster (heap usage is ~5% higher). This is
+lower than the skyrocketing speedups observed on some microbenchmarks,
+but itâ€™s probably no surprise: these `guix` commands are short-lived (a
+couple of seconds) and theyâ€™re rather I/O- and GC-intensiveâ€”something
+JIT compilation cannot help with.
+XXX: Add AArch64 figures.
+## Gluing it all together
+The last part of the GuileÂ 3 migration has to do with how Guix, an in
+particular Guix System, glues things together. As explained above, Guix
+manipulates several stages of Scheme code that will run a different
+points in time.
+First, the code that runs package builds, such as [the one that runs
+`./configure && make && make
+is Guile code. Currently that code runs on GuileÂ 2.2, but on the next
+major rebuild-the-world upgrade, we will switch to Guile_3.
+Additionally, Guix produces Scheme code consumed by [the
+[GNUÂ mcron](https://www.gnu.org/software/mcron), and for [the graphical
+These will soon switch to GuileÂ 3 as well. This kind of change is made
+easy by the fact that both the package definitions and the staged code
+that depends on those packages live in the same repository.
+# Long live, GuileÂ 3!
+Migrating Guix to GuileÂ 3 is a bit of work because of the many ways Guix
+interacts with Guile and because of the sheer size of the code base.
+For a â€ś2-to-3â€ť transition though, it was easy. And fundamentally, it
+remains a cheap transition compared to what it brings: better
+performance and new features. Thatâ€™s another benefit of using a
+Thumbs up to everyone involved in its development, and long live,
+#### About GNU Guix
+[GNU Guix](https://guix.gnu.org) is a transactional package
+manager and an advanced distribution of the GNU system that [respects
+Guix can be used on top of any system running the kernel Linux, or it
+can be used as a standalone operating system distribution for i686,
+x86_64, ARMv7, and AArch64 machines.
+In addition to standard package management features, Guix supports
+transactional upgrades and roll-backs, unprivileged package management,
+per-user profiles, and garbage collection. When used as a standalone
+GNU/Linux distribution, Guix offers a declarative, stateless approach to
+operating system configuration management. Guix is highly customizable
+and hackable through [Guile](https://www.gnu.org/software/guile)
+programming interfaces and extensions to the
diff --git a/website/static/blog/img/guile-3.png
new file mode 100644
Binary files /dev/null and b/website/static/blog/img/guile-3.png differ
|[Prev in Thread]
||[Next in Thread]|
- branch master updated: website: Add draft of post about Guile 3.,
Ludovic Courtčs <=