guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On a Guile-based Build-Tool complimenting Guix


From: Attila Lendvai
Subject: Re: On a Guile-based Build-Tool complimenting Guix
Date: Fri, 20 Dec 2024 17:31:03 +0000

> The other day, after being frustrated of build systems (auto-tools,
> meson, maven etc.), I wondered why doesn’t Guix which has such
> powerful tools within it (`guix build`, `guix pack` etc.) also not
> have a purely Guile-based build tool? After all, our goal is to make
> deployment, and building both more declarative and away from the
> all-too-familiar “dependency hell”.


just a word of warning: proper build systems are surprisingly complicated 
beasts.

even when they are old and not too well designed, like makefiles, they still 
have lots of moving parts with strange peculiarities. if you want to be 
compatible with e.g. makefiles written by upstream, then it will take a lot of 
effort. although, i'm not sure whether that is part of your goals. maybe you 
just want to provide an alternative build system, and merely inspire upstream 
authors to migrate to it? (as opposed to providing a compatible guile-based 
build script in parallel to upstream's makefiles)

nevertheless, here's a random pick from the relatively recent history of making 
ASDF (common lisp) usable; i.e. not great, just usable: fasl files needed to be 
split in two: compile time and runtime. the compilers had to be patched for to 
emit compile-time side effects into a different fasl file (defining something 
is also a side effect). then ASDF needed to be extended to differentiate 
between compile-time and runtime dependencies. this was a necessary, but not 
sufficient step to make ASDF reproducible. then lots of packages had to be 
patched to e.g. adjust dependency specifications so that e.g. macro definitions 
have a proper lifetime.

AFAIU guile modules are much better in this regard than the CL model, but they 
may also have toplevel expressions that have side effects that are external to 
the module that is being compiled/loaded. this is not common, and not good 
style, but i think it's not forbidden either. if so, then the same treatment 
would be needed for such a hypothethical build system and the guile ecosystem 
in general.

in short: beware that your proposal may in fact easily be something like: 
"let's rewrite e.g. bazel in guile!"

and as a final note: below is a nice bird's eye view on build systems. it's 
part of an enlightening series of chapters where a martian programmer crashes 
their ship on earth and enters into a dialog with a human programmer while 
trying to rebuild his ship:

https://ngnghm.github.io/blog/2016/04/26/chapter-9-build-systems-and-modularity/

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Forces beyond your control can take away everything you possess except one 
thing, your freedom to choose how you will respond to the situation.”
        — Viktor E. Frankl (1905–1997), 'Man's Search for Meaning' (1946)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]