Skip to content

Comment on Guix for Development

Comments

I don't understand how the Guix documentation can refer to #:uninterned #:symbols as "keywords"; was that written with a straight face? Yikes. Common Lisp's single : sigil is perfect for keywords; two characters is excessive.

Why does gnu-build-system use %standard-phases (a symbol with %)? You'd think it could just use standard-phases. What is the big namespace concern. The % prefix is a Lisp convention for implementation internal symbols, not to be used by user code. Kind of like double underscore in C.

It could simply be the mplicit default. If most rules use %standard-phases, it's silly to be repeating it all over the place.

modify-phases could have a syntax like:

   (modify-phases {phases-object | clause }*)
If an argument is a phases-object, then it's taken as the current object on which the remaining clauses operate. Otherwise it's a clause like (add-after ...). The initial current object is understood to be %standard-phases. Now you just do:
     (modify-phases
       (add-after 'unpack 'bootstrap
         (lambda _ (invoke "sh" "bootstrap")))
One piece of noise gone; N more to go.

About the lambda, a simple idea would be that if the registered function is a list object (pair), then it's treated as list of exec arguments:

     (modify-phases
       (add-after 'unpack 'bootstrap '("sh" "bootstrap")))
either add-after performs the transformation to lambda + invoke, or else the object stays as a list, and is later treated as a command to execute.

A macro like (cmdf "sh bootstrap") could do the parsing and generate the lambda + invoke. The "f" reminds you that it doesn't run the command but returns a function.

It's written in Guile, which is a variant of Scheme. #: is used as the keyword indicator, not an uninterned symbol like in CL.

Why does gnu-build-system use %standard-phases (a symbol with %)

AFAIK %symbol indicates a constant in Scheme.

It's unfortunate that it isn't written in Common Lisp. CLOS would've been immensely useful there instead of the ad-hoc object system via Scheme records.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.