all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Ian Eure <ian@retrospec.tv>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix CLI, thoughts and suggestions
Date: Tue, 16 Jan 2024 09:08:41 +1100	[thread overview]
Message-ID: <87o7dmgsgm.fsf@zancanaro.id.au> (raw)
In-Reply-To: <87il3upczg.fsf@retrospec.tv> (Ian Eure's message of "Mon, 15 Jan 2024 11:24:29 -0800")

Hi Ian,

Much of what you've written is fair, and I'm sure that Guix's commands
could be better organised. I'm not really involved in Guix development,
but I think there are two "inconsistencies" that you've mentioned which
can be explained.

On Mon, Jan 15 2024, Ian Eure wrote:
> Some examples of where I think Guix could do better.  This is an
> illustrative list, not an exhaustive one.
>
> Inconsistent organization
> =========================
>
> Most package-related commands are under `guix package', but many are
> sibling commands.  Examples are `guix size', `guix lint', `guix hash',
> etc.

I think the real inconsistency here is that `guix package' is poorly
named. This command really operates on profiles, and performs operations
(install, remove, list, etc.) on those profiles. Packages are given as
arguments to this command.

The other commands operate on, and show the properties of, packages.
Similarly with `guix build'.

> Inconsistency between verbs and options
> =======================================

> ... For example, installing a package is `guix package -i foo' rather
> than `guix package install foo', removing is `guix package -r foo'
> rather than `guix package remove foo', and listing installed packages
> is `guix package -I' rather than `guix package installed' (or
> similar).

The specific example of `guix package' might be explained by considering
it as a single transaction to update the profile. The command `guix
package' really says "perform a transaction on the profile", and the
options are the commands in the transaction. Since there can be multiple
commands, and the command names look like package names, they are
provided as options.

This doesn't fully explain the behaviour. In particular the example you
give:

> This means that users can express commands which *seem* like they
> should work, but do not.  For example `guix package -i emacs -r
> emacs-pgtk -I' represents a command to 1) install emacs 2) remove
> emacs-pgtk 3) list installed packages (which would verify the previous
> two operations occurred). ...

seems reasonable to have working within the view of `guix package' as a
transactional operation.

It's also worth noting that there are convenience shortcuts in `guix
install' and `guix remove'.

> It seems like a lot of work to change, and backwards compatibility
> also is an issue.

I see backwards compatibility as the main issue here. There was a lot of
discussion preceding the inclusion of `guix shell', because of the
prospect of breaking existing tutorials/documentation floating around on
the internet. This is an even bigger concern for a more drastic
reorganisation of the CLI.

Carlo


  parent reply	other threads:[~2024-01-15 22:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 19:24 Guix CLI, thoughts and suggestions Ian Eure
2024-01-15 21:01 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-01-15 22:08 ` Carlo Zancanaro [this message]
2024-01-20 22:50   ` Ian Eure
2024-01-22  0:21     ` Carlo Zancanaro
2024-02-04 12:21       ` Rostislav Svoboda
2024-01-17  7:21 ` Efraim Flashner
2024-01-18 13:51   ` Rostislav Svoboda

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=87o7dmgsgm.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=guix-devel@gnu.org \
    --cc=ian@retrospec.tv \
    /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.