From: rendaw <7e9wc56emjakcm@s.rendaw.me>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: help-guix@gnu.org
Subject: Re: guile scheme tutorial
Date: Tue, 7 May 2019 13:35:19 +0900 [thread overview]
Message-ID: <3b95f670-336a-c7e9-b2e0-768e2bb99342@s.rendaw.me> (raw)
In-Reply-To: <87pnoy7g1c.fsf@gnu.org>
On 5/4/19 5:57 PM, Ludovic Courtès wrote:
> Hi rendaw,
>
> rendaw <7e9wc56emjakcm@s.rendaw.me> skribis:
>
>> Oh, this is great! I've actually been putting together a small Guix
>> guide here:
>> https://gitlab.com/rendaw/blog/blob/master/how_to_guix_for_those_who_dont.md
> Nice!
>
> I skimmed at
> <https://gitlab.com/rendaw/blog/blob/master/a_brief_guix_review.md> and
> I wonder if you could point out areas where documentation is severely
> lacking? We’d all very much welcome improvements to the manual so your
> insight as a newcomer is valuable.
>
> (Besides I wouldn’t consider mailing lists as a “user hostile” tool, but
> that’s not another story…)
>
> Thanks,
> Ludo’.
Thanks for looking at that! I appreciate you asking and I'd like to
provide a careful answer.
The documentation currently excels at:
1. Installation (straightforward, theory light steps for getting started)
2. Listing commands and arguments
3. Specific use cases - setting up an application, bootstrapping the
installer, creating graphs
The areas that were important for me but weren't well documented were:
1. Concepts
* What is functional package management? What is garbage collection?
How do these work?
What is a package? How does Guix determine what makes a package
unique? What's a derivation, and what's the relationship between
derivations and packages? The best I could find is that a derivation
communicates an action to the store, but that uses vocabulary in ways
that 99% of readers won't be familiar with ("communicate", "action",
isn't the "store" a directory?) and is so abstract that it won't help
people make choices dependent on that. What's a tangible example of a
derivation? Where and why would someone use a derivation directly?
The only gc documentation says that anything reachable from a root won't
be deleted, but doesn't explain what a root is, how they're created, how
they're identified, how they're removed, etc.
What's a profile? The documentation says where they're stored, but not
how they interact with garbage collection. What's the relationship
between a profile and a system config scm file?
What is a system generation? How does this relate to the above? How
does it work, maybe with a tangible example.
* What happens when running guix system?
How is the config file used? The documentation says that the config scm
has should contain the operating system definition, but that's wrong -
it should return the operating system definition. The config itself is
essentially a function, and I've seen confusion due to that not being
clearly explained in other threads ("Installing a package using guile
script").
What does guix system do with the definition once it's returned? How
does install happen on a live system? What stages are there in the install?
How does this process change for the different install targets? (vm,
disk-image, docker image, etc)
* G-expressions
The analogy to quotes is useful, but how do these actually work?
They're relocatable - how does one store them to disk? Read them from
disk an execute them? Or execute them from memory? Quotes can be
converted back from data using `eval` - what's the g-expression
equivalent? Where can they be used (maybe this is more a reference
thing - which functions take g-expression arguments)?
What is lowering, what can be lowered, and what's the relation between
lowering and g-expressions?
How do you run a program in a g-expression? This seems like one of the
most fundamental things one would do in a g-expression (especially when
interfacing with a world of non-guile software) but AFAICT it's only
addressed indirectly in a blog post. The blog post says use invoke, and
that invoke should be used instead of system*. Why? What does it do
differently? If invoke is better, why does Guix source use system*?
* Package creation
Again, the documentation says "use these build systems" but not why, or
what they do. How does a build system transform a bunch of files into
something in /gnu/store? What are the expectations of a package (where
do binaries go, shared libraries, etc). Kernel modules? Plugins for
other software? Things with a global registry file/directory?
How do dependencies between packages work? How are packages exposed to
users? How are packages exposed to services? How are packages exposed
to other packages? And I don't mean how as in "what's the canonical way
to access package X" but "all these packages are in different
directories - how does the build process know that this package needs to
access this directory instead of this other directory?"
IMO it would be better to start with the trivial build system, say "we
have these files, here's how we turn it into a package" then show how
the build systems make it much simpler but that they're just an
extension of first principles.
* Services
I've been discussing this in another thread, but it's the same thing -
what a service is is unclear because it hinges on the use of the word
"extend" which isn't defined.
2. Reference
* Specifications
The arguments to functions are defined but what the function/macro
returns is often missing or incompletely defined. `service` returns a
record of type `<service>` with fields `type` and `value`. Without
knowing this stuff it's impossible to effectively "program" around it -
ex: filtering services, doing match, introspecting packages, etc.
`scheme-file` returns an object - what sort of object, how can it be
used, etc.
For arguments with enumerative or switch parameters, how the function
behaves with different values is only partially defined. Ex:
needed-for-boot? only describes what happens when #t, not when #f. Same
with #volatile-root? in initrd.
Function specifications should have a much more rigorous format. Links
to related definitions would be awesome too.
* Current status
There's a lot of "this doesn't work yet" type comments in the code, but
isn't mentioned in the documentation. Ex: disk-image with uefi
bootloaders. Users will read about features in the documentation,
assume it works (it's documented and there's no caveats), and then dump
N hours into trying to figure out what they did wrong.
* Comprehensiveness
Many auxiliary methods are not defined. For example,
`use-package-modules` and `use-service-modules`. These appear
frequently in the documentation, but it's unclear why you'd use those
instead of `use-modules` and the syntax is subtly different. `mkdir-p`,
`chmod`, `make-forkexec-constructor` (it's hard to create shepherd
services without this), `call-with-output-file`, ...
I listed a lot of specific points because I think it's the best way to
communicate how I got blocked, but I don't think these should be
explicitly answered in the documentation. If the documentation starts
with theory/concepts, such as explaining that "invoke runs a program
with system* but raises an exception if the return code is nonzero",
then the explanation of why it should be preferred to system*, how it's
different to system*, and what situations each should be used in is
stuff the reader can easily reach on their own.
next prev parent reply other threads:[~2019-05-07 4:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 12:45 guile scheme tutorial amirouche
2019-05-03 17:15 ` Guy fleury
2019-05-03 21:11 ` Laura Lazzati
2019-05-03 23:44 ` amirouche
2019-05-04 1:51 ` rendaw
2019-05-04 6:08 ` rendaw
2019-05-04 8:57 ` Ludovic Courtès
2019-05-07 4:35 ` rendaw [this message]
2019-05-08 12:46 ` Ludovic Courtès
2019-05-08 13:15 ` Pierre Neidhardt
2019-05-08 16:35 ` swedebugia
2019-05-13 7:10 ` rendaw
2019-05-13 8:00 ` Pierre Neidhardt
2019-05-08 20:21 ` Guix cookbook (was: guile scheme tutorial) Ricardo Wurmus
2019-05-09 15:14 ` Pierre Neidhardt
2019-05-09 21:38 ` Ricardo Wurmus
2019-05-13 9:08 ` Guix cookbook swedebugia
2019-05-04 11:02 ` guile scheme tutorial amirouche
2019-05-04 11:25 ` Laura Lazzati
2019-05-07 2:15 ` rendaw
2019-05-07 7:09 ` amirouche
2019-06-06 15:45 ` Laura Lazzati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b95f670-336a-c7e9-b2e0-768e2bb99342@s.rendaw.me \
--to=7e9wc56emjakcm@s.rendaw.me \
--cc=help-guix@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.