Hi guix,

For modularizing I am talking about C++ modules that introduced in C++20. They 
are similar to modules in Guile which is a way to organize code that can import 
form and export to. Modules provide a better way organize code than our old 
friend, header files.
You can learn more about C++ modules from Rainer Grimm’s blog[1].

Recently I successfully convert almost all guix-daemon’s C++ code into 
modules[2]. And I found the compilation time of guix-daemon decrease a little 
on my machine (from 3m18s to 2m45s). Beacuse some C++ module features are only 
avaliable since GCC 15, I will send merge request maybe after next core-update.

Indeed this update will not affect your daily usage of guix directly. But we 
establish a more modular codebase that will benifit our further improvement of 
guix-daemon. We don’t need to worry about the one definition rule(ODR) 
introduced by header files anymore. As my previous post to guix-devel[3], my 
final goal is to reduce codebase size of guix-daemon.

Regards,
Kuo

[1] 
https://www.modernescpp.com/index.php/c20-module-support-of-the-big-three-compilers/
[2] https://codeberg.org/congcongkuo/guix-daemon-modularize
[3] https://lists.gnu.org/archive/html/guix-devel/2025-05/msg00215.html

  • Proof of Concept:... Congcong Kuo

Reply via email to