[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can zig-build-system be an alternative to the gnu-build-system?
From: |
Philip McGrath |
Subject: |
Re: Can zig-build-system be an alternative to the gnu-build-system? |
Date: |
Thu, 02 Feb 2023 12:52:28 -0500 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-107-g82c3c54364-fm-20230131.002-g82c3c543 |
Hi Pjotr,
On Wed, Feb 1, 2023, at 5:11 AM, Pjotr Prins wrote:
>
> There have been some older discussions about creating our own
> replacement for autotools, cmake and others. I often fight these make
> make systems - and meson and/or language specific build systems. It is
> a time waster for programmers and none of these systems leverages the
> power of Guix itself. I kinda settled for cmake because, even though
> it is an effing dragon, at least I can make it work (pun intended).
>
> We need someone with deep experience in build systems to write a guile
> replacement - generating ninja is one idea. That is my opinion :). I
> would love a simple way to describe a project in guile. It should not
> be too hard actually (famously that is how these projects start and
> turn out to be a real time sink). Maybe someone wants to try with
> guidance from us, or maybe we can do it when we get bored some day.
>
You might be interested in Zuo, which was created to replace the work of `make`
in the build system for Racket and Racket's branch of Chez Scheme. (The name
comes from a Chinese word for "make".) It's packaged for Guix:
https://packages.guix.gnu.org/packages/zuo/
The documentation is at: https://docs.racket-lang.org/zuo/
One important aspect is that the primary implementation is *not* in Racket or
Guile: a single C source file implements the tiny Scheme-like language, and
most of the functionality is implemented in the Zuo language. This simplifies
bootstrapping, and it also means that, if your project already needs a C
compiler, you can add Zuo without adding a build dependency on another
scripting language. (On unfriendly systems like Windows, even requiring Python
can be a significant complication.)
By design, Zuo does not try to replace the `configure` part of your build
system: Racket uses Autoconf, and Chez has its own custom `configure` script.
Similarly, it works well to have a stub Makefile that just runs Zuo, and Zuo
even cooperates with the GNU Make jobserver. When Racket adopted Zuo, almost
all make-based workflows continued to work unchanged.
The build system part of Zuo is modeled on Shake (used by GHC). The paper
"Build Systems à la Carte" is a nice overview of the design space:
https://dl.acm.org/doi/pdf/10.1145/3236774
The thread about replacing Racket's build scripts is here:
https://github.com/racket/racket/pull/4179
-Philip