guix-devel
[Top][All Lists]
Advanced

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

Re: how to write services (was: Re: Teams)


From: Maxime Devos
Subject: Re: how to write services (was: Re: Teams)
Date: Thu, 16 Jun 2022 10:27:02 +0200
User-agent: Evolution 3.38.3-1

Blake Shaw schreef op do 16-06-2022 om 06:20 [+0700]:
> But, perhaps it's just getting late and the matters are now & the
> details are slipping my mind, but im starting to realize im unsure of
> many examples of file-like objects that aren't a file? The email
> where you responded re: packages was cut short, but it seemed to be
> that you were saying that record-types *aren't* file-like,

I wrote that a package record #<package [the hello package]> is not a
file (as it lacks a lot of operations and properties that would be
expected of a package, such as 'stat', 'read', 'write', and a file
name’.

Likewise, the <package> record type (!= an instance of the record type
<package>) is not a file, but that's going rather meta.

However, packages (not the package _type_, but packages) are definitely
file-like, because when used in a G-exp with #$ or #+, Guix is able to
automatically ‘lower’ it in the store (resulting in a /gnu/store/.../
file name).

>  when I had thought they are; I thought anything with simple means of
> serialization could be considered file-like,
> [...]

It depends on the serialisation.  Not any serialisable object can do,
it must be an object that _Guix_ considers to be serialisable -- in
Guix terminology, this is called a ‘lowerable’ (low-level terminology)
or ‘file-like’ (high-level terminology, equivalent to ‘lowerable’
AFAICT) object.

> Would anyone care to share an explanation of what is/is not a
> file-like object in Guix? 
> Are fluids not considered file-like?

They aren't, as they do not implement lowering. (Technically: they
don't have a ‘define-gexp-ompiler’).

> I had thought that would be a use case where this geneticity becomes
> important.

Why would one put a fluid in a G-exp?  I suppose we could define what
lowering is for fluids (probably: get the value of what's inside and
lower that value), implement it in the Guix code and document it, and
hence consider fluids to be file-like.

I suppose that's all technically possible, though shouldn't it then be
extended to SRFI-111 boxes, parameter objects, variable objects,
promises and thunks as well?  Where would we stop?  And is this
behaviour actually useful?


> I remember when I first encountered gexps I thought, as FLOs didn't
> seem to be files, they were either records or fluids.

There is only a single mention of fluids in the manual (concerning
%guile-for-build).  The related concept of parameters is never used in
(guix)G-expressions, (except for 'with-parameters’).  So I fail to see
where this could have come from.

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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