unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ryan Prior <ryanprior@hey.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Development of GNU Guix and the GNU System distribution
	<guix-devel@gnu.org>
Subject: Re: Announcing emacs-guix-packaging
Date: Fri, 13 Nov 2020 01:28:44 +0000	[thread overview]
Message-ID: <b0ab7524ec33b251f16aca9fb39451b69e53b045@hey.com> (raw)
In-Reply-To: <875z6aguv8.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3530 bytes --]

On November 12, 2020, "Ludovic Courtès" <ludo@gnu.org> wrote:
> Looks nice and useful!

Thank you! If you end up using it, I'd be interested to hear feedback
about what works well and what could go in a different direction.

> Did you consider making it part of Emacs-Guix? That’d give us a single
> go-to place for all things Guix in Emacs.

I don't use emacs-guix myself. I've tried it a couple times but it's
junky. Specifically, it incorporates a lot of custom Guile logic and
depends on internal Guix APIs. This design does not benefit anybody.
It's harmful for the Guix project because having third-party
applications depend on your internal APIs locks you down, where you
can't refactor internal logic without breaking other people's stuff. And
it's sad for users because it exposes them to that routine brokenness,
which in my case has prevented me from ever getting any use out of it
when I've tried it.

And I know I'm not just unlucky: at least once a month we get people in
the IRC or Matrix rooms for Guix who are unable to make emacs-guix work
on their machines. For an interface to Guix, which aims to solve
software deployment problems, this is especially cringe-inducing. It
shows the fundamental weakness of the package's technical design.

So as a result I'm not really interested in contributing to emacs-guix.
I would of course not object if its maintainer wanted to incorporate
parts of my package into theirs. They are both GPLv3.

On the other hand, I am interested in building out a formal API for
tools to interface with Guix without having to depend on its internals
or parse the output of its CLI commands. This could be a Guile API,
although I picture json would be a better choice to support diverse
tooling.

For one example of what I'd want the API for, in my `guix-packaging-
insert-input` command I need to get the list of available Guix packages,
and then for the selected package I need to find its scheme symbol. The
emacs-guix approach to those things is to reach into Guix internal data
structures and read out that data, which doesn't deliver results in
practice. I opt instead to parse the output of the CLI command `guix
package -A ""` as a tsv, which works as long as Guix doesn't change its
output, but that's not guaranteed either.

The format of the output from Guix CLI commands varies quite a lot.
After parsing the tsv from one command, the next step is to find the
corresponding scheme symbol for the chosen package, for which I parse
the output of `guix show <pkg>` but that's not tsv, that's recfile
format. And it doesn't provide the name of the scheme symbol, so I then
go load the source code and look for a `define-public` to scrape the
symbol.

So what I'd want is a uniform scripting interface where I can query Guix
and get responses in a uniform way, whether that's json, recfile, edn,
msgpack, or Guile s-expressions or whatever. Just so it's an explicitly
documented external API that won't change arbitrarily, doesn't freeze
Guix internals, and only requires me to parse one type of output. At
some point in the future I can write more about that, and I'm down to
contribute the labor to make it happen too. We can use this thread as a
kick-off point for that discussion too if you're interested.

But in any case I just wanted to provide some context for why I didn't
build this as an extension to emacs-guix. Hope this helps!

Ryan

[-- Attachment #2: Type: text/html, Size: 5836 bytes --]

  reply	other threads:[~2020-11-13  1:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  5:07 Announcing emacs-guix-packaging Ryan Prior
2020-11-10 13:30 ` Pierre Neidhardt
2020-11-12 20:53 ` Ludovic Courtès
2020-11-13  1:28   ` Ryan Prior [this message]
2020-11-13  9:45     ` Pierre Neidhardt
2020-11-13 13:20       ` zimoun
2020-11-13 14:54         ` John Soo
2020-11-13 16:54       ` Reviving Emacs-Guix Ludovic Courtès
2020-11-13 17:13         ` John Soo
2020-11-13 18:42         ` zimoun
2020-11-16  8:56           ` Ludovic Courtès
2020-11-14  9:42         ` Pierre Neidhardt
2020-11-14 12:57           ` zimoun
2020-11-14 15:59             ` Pierre Neidhardt
2020-11-14 16:56               ` zimoun
2020-11-14 17:30                 ` Pierre Neidhardt
2020-11-14 18:40                   ` zimoun
2020-11-14 19:15                     ` Pierre Neidhardt
2020-11-14 19:52                       ` Ricardo Wurmus
2020-11-14 21:29                         ` zimoun
2020-11-15  7:37                           ` Pierre Neidhardt
2020-11-15 13:15                             ` zimoun
2020-11-15 14:11                               ` Pierre Neidhardt
2020-11-15 15:23                                 ` zimoun
2020-11-15 15:45                                   ` Pierre Neidhardt
2020-11-15 16:05                                     ` zimoun
2020-11-14 21:11                       ` zimoun
2020-11-15  7:53                         ` Pierre Neidhardt
2020-11-14 19:49           ` Ricardo Wurmus
2020-11-15  7:36             ` Pierre Neidhardt
2020-11-16  9:02             ` Ludovic Courtès
2020-11-16  9:18               ` Pierre Neidhardt
2020-11-16 12:01                 ` zimoun
2020-11-16 12:20                   ` Pierre Neidhardt
2020-11-16 12:47                     ` zimoun
2020-11-17  7:53                       ` Pierre Neidhardt
2020-11-13 12:31     ` Announcing emacs-guix-packaging zimoun

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=b0ab7524ec33b251f16aca9fb39451b69e53b045@hey.com \
    --to=ryanprior@hey.com \
    --cc=guix-devel@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 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).