Hi,

On Tue, 13 May 2025 05:21:14 +0800
minung...@gmail.com wrote:
> But why Zig? As for me, Zig shows a possibitily to get rid of current
> toolchain. Even though C is not a bad language (I think C is good
> enough!), nowadays GCC is written in C++ which is a monster. Zig has
> lots of improvements comparing with C but it is still a elegant
> language. Zig can easily call and be call by C/C++, which means I can
> gradually apply Zig in a C/C++ project.

An issue to keep in mind is that there was a lot of work made to be
able to bootstrap the C toolchain from source[1].

So as I understand the current state of things in that area is that for
some architecture like x86_64 you just need a running GNU/Linux system,
guile and also and probably a script to bootstrap everything from
source.

So how could zig fit into that? Could it reduce even more the set of
minimal binaries required? Or would it require a significant amount of
work to keep all the work on bootstrapable builds if the zig language
is being used in the daemon at some point?

Another thing is that zig is known to be able to produce
binaries for recent macOS, and even cross compile them with a fully
free toolchain, and last time I checked, gcc toolchains were not
known to be able to do that but in practice I'm unsure how relevant
something like that would be as porting Guix to macOS always stalled
due to issues related to the absence of glibc for macOS.

But for that use case, it could also be relevant to use zig only for
cross compilation instead of building the guix-daemon with it, to do
something like in the case of mingw (the {i686,x8664}-w64-mingw32
targets of various guix commands like guix build), though I'm unsure if
there is a generic enough way to hook zig into various build systems
(zig cc command line options might not be exactly the same than the ones
provided by GCC, and wrappers do not always work fine (there was a GCD
about it)).

References:
-----------
[1]https://guix.gnu.org/manual/en/guix.html#Bootstrapping

Denis.

Attachment: pgpD1iBb_WTBL.pgp
Description: OpenPGP digital signature

Reply via email to