unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bengt Richter <bokr@bokr.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: extending the documentation of the Scheme API
Date: Mon, 23 Dec 2019 03:44:47 -0800	[thread overview]
Message-ID: <20191223114447.GA37723@PhantoNv4ArchGx.localdomain> (raw)
In-Reply-To: <87sgleprp6.fsf@elephly.net>

Hi Ricardo, Guix

On +2019-12-20 23:17:41 +0100, Ricardo Wurmus wrote:
> Hi Guix,
> 
> we have lots of nice macros and procedures in Guix that aren’t
> documented beyond their docstrings.
> 
> Should we snarf the docstrings and add them to the manual?
> 
> --
> Ricardo
> 
> 

My 2 cents, if I may:

I would _much_ rather be able to "snarf" dynamically from the command line
to stdout or -o file using appropriate parameters and options.

Even something dead simple like
gx-apropos:
--8<---------------cut here---------------start------------->8---
#!/usr/bin/bash
guile -c '(use-modules (ice-9 session))(apropos '"\"$*\""')'
--8<---------------cut here---------------end--------------->8---

quickly gets me syntax essentials for default modules.
(I have to do another variant to get this apropos to see rnrs bytevectors
or other non-default modules). Yet another variant uses oop goops describe.

I can view a manual and search it in emacs, but even so, sometimes I'd rather
insert the result of a command line invocation from within emacs.
It only takes a few seconds to grep the whole guix git repo, a bit longer for /gnu.

Speaking of the latter, here is an alpha kludge to do approximately what
ArchLinux's pacman -Qo does (find what package a given executable belongs to).

pacman -Qo $(which pacman)
--8<---------------cut here---------------start------------->8---
/usr/bin/pacman is owned by pacman 5.2.1-1
--8<---------------cut here---------------end--------------->8---

my gx-Qo version (takes multiple args and shows pure vs not):

gx-Qo g++ as readelf emacs lsblk less weston wayland gxQo
--8<---------------cut here---------------start------------->8---
g++:	gcc-9.1.0
as:	binutils-2.32
readelf:	binutils-2.32
emacs:	emacs-26.3
lsblk:	util-linux-2.34
less:	less-530
weston:	weston-6.0.1
wayland:	(which: did not find)
gx-Qo:	(impure: '/home/bokr/bin/gx-Qo')
--8<---------------cut here---------------end--------------->8---

When I get around to it I'll add a -a option to do which -a to
report on all found. Also a -L option to report each link
(possibly a chain) leading to to the executables.

When/if I do, it will be an example of upgrading a single simple
dynamic "documentation" producer vs upgrading a document per se.

I much prefer dynamically on-the-fly-produced documentation of
the state of my system -- like /proc stuff -- it's always up to date :)
And emacs will let me escape with C-z to get to the command line
when that is convenient (or necessary if pts doesn't do some tty thing).

IMHO composing _independent_ functionalities ad-lib and powerfully
is the best gift of the bash command line.

    ...|guix hash -|...
allows me to use guix's internal default composition of sha256sum and base32,
but bash can already get at the former and IMHO it would enhance
general composability if guix's base32 were packaged as external to guix hash,
so that bash could make use of the nix encoding also, that would be a plus for me
e.g. maybe like
    ...|sha256sum|cut -d ' ' -f1|gx-base32|...

It's a matter of what options you have to compose functionality.
IMHO it would be good policy externalize hidden nuggets
of shell-composable functionality whenever the nuggets don't need
the package they come in to function.

I think this should be viewed at the system architecture level
so that the natural Chauvinism of an exciting project does not
in effect create a walled garden that prohibits[1] cloning a
simple (with simple system abi dependencies) internal wheel barrow 
for use at home.

[1]I know "prohibits" does not apply to extracting nuggets
from FOSS, but the effort can be prohibitive, where the original
developers of the nugget could have made it easy in many cases :-/

HTH in some way :)

-- 
Regards,
Bengt Richter

  parent reply	other threads:[~2019-12-23 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 22:17 extending the documentation of the Scheme API Ricardo Wurmus
2019-12-21  1:45 ` John Soo
2019-12-21  4:04 ` Jesse Gibbons
2019-12-21 12:24   ` Pjotr Prins
2019-12-23 11:44 ` Bengt Richter [this message]
2019-12-29  8:20 ` Jan Nieuwenhuizen
2019-12-30 18:38   ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191223114447.GA37723@PhantoNv4ArchGx.localdomain \
    --to=bokr@bokr.com \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).