git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Patrick Donnelly <batrick@batbytes.com>
Cc: "Eric S. Raymond" <esr@thyrsus.com>,
	Sitaram Chamarty <sitaramc@gmail.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	Michael Haggerty <mhagger@alum.mit.edu>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	git@vger.kernel.org
Subject: Re: Python extension commands in git - request for policy change
Date: Wed, 12 Dec 2012 03:32:11 -0500	[thread overview]
Message-ID: <20121212083210.GB18322@sigill.intra.peff.net> (raw)
In-Reply-To: <CACh33FrgZhsKp7o9ki6n1AbfRKYYbdLMWuGUGKUqDfH5m0Akng@mail.gmail.com>

On Wed, Dec 12, 2012 at 02:03:56AM -0500, Patrick Donnelly wrote:

> On Wed, Dec 12, 2012 at 1:32 AM, Jeff King <peff@peff.net> wrote:
> > It would take a lot of effort to expose git-core's internals in a clean
> > way; you'd probably be better off starting from scratch and rewriting
> > large parts in a friendly library-like manner. Fortunately, there is
> > already a project underway to do so: libgit2.  It does not yet have
> > feature parity with git, but it can do quite a bit.  And there are
> > already ruby and python bindings.
> 
> Of course, this comes back to the issue of whether it's a good idea to
> use perl/ruby/python as a front-end to regular git commands
> (pull/push/etc.).

Yeah, I think that is a separate issue, though. I cannot see us ever
writing core commands like "git pull" in any scripting language besides
POSIX shell due to dependency issues. So language bindings are really
for things that are not going to go into git-core, or are ancillary
commands that people can live without (e.g., git-add--interactive,
remote helpers, etc).

> While, yes, bindings can be made for these languages, you are now
> making git depend on the presence of one of these languages in order
> for git to function. With Lua, the (static) dependence is very small
> yet brings much to git in terms of extensibility and maintainability.

And I would include Lua in my list of "I cannot see..." above. It can be
statically linked, so it is not a run-time dependency, but it would
still be a build-time dependency. The community has historically been
pretty resistant to dependencies (I do not care too much myself,
though).

I think doing anything significant in Lua would have the same problem as
doing anything significant in Python: there would need to be substantial
internal cleanup to make sane bindings. And again, that is what libgit2
is doing (and yes, there are Lua bindings for it already).

Using libgit2 bindings would introduce a new dependency, of course, but
that is on par with a Lua dependency.

> As for Lua's suitability for your (2) point, I admit I'm not familiar
> with how much "interacting with the outside world" the git commands
> do; however, I would suspect that it is not significant enough to rule
> Lua out?

I did not mean to rule it out for point (2); I only meant that it is
probably the only reasonable thing for point (1), whereas for point (2),
we have many more options.  I suspect Lua would do just fine given the
right set of modules, though I tend to prefer other languages myself
when embeddedness is not an issue.

As for "interacting with the outside world", I was specifically thinking
of stuff like git-send-email (currently in perl) and git-imap-send
(written in C). They need to open network sockets and speak standard
protocols. I suspect Lua would need a module or custom bindings to do
the former at all, and certainly the code would be much simpler if we
re-used standard modules for speaking SMTP and IMAP (which of course
increases our dependencies again...).

-Peff

  reply	other threads:[~2012-12-12  8:32 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-25  2:44 Python extension commands in git - request for policy change Eric S. Raymond
2012-11-25  3:15 ` Nguyen Thai Ngoc Duy
2012-11-25  5:18   ` Eric S. Raymond
2012-11-25  8:56     ` Felipe Contreras
2012-11-25  9:54       ` Eric S. Raymond
2012-11-25 11:48         ` Felipe Contreras
2012-11-25 17:50           ` Eric S. Raymond
2012-11-25 21:22             ` Felipe Contreras
2012-11-25 21:56               ` Eric S. Raymond
2012-11-26 13:11                 ` Felipe Contreras
2012-11-27  7:54                   ` David Aguilar
2012-11-27  8:43                     ` Felipe Contreras
2012-11-27  9:17                     ` Sitaram Chamarty
2012-11-27 10:51                       ` David Aguilar
2012-11-27 22:01                         ` Guillaume DE BURE
2012-11-27 15:33                     ` Johannes Schindelin
2012-11-28  2:09                 ` Felipe Contreras
2012-11-25 17:21     ` Johannes Schindelin
2012-11-25 10:26   ` Pat Thoyts
2012-11-25 10:33     ` Eric S. Raymond
2012-11-25 15:51       ` Erik Faye-Lund
2012-11-25  8:53 ` Felipe Contreras
2012-11-25  9:53   ` Eric S. Raymond
2012-11-25 11:19     ` Felipe Contreras
2012-11-25 17:32       ` Eric S. Raymond
2012-11-25 21:43         ` Felipe Contreras
2012-11-25 22:44           ` Eric S. Raymond
2012-11-26 11:05             ` Andreas Ericsson
2012-11-25 10:44   ` Michael Haggerty
2012-11-25 10:57     ` Eric S. Raymond
2012-11-25 11:51       ` David Lang
2012-11-25 12:01         ` Stefano Lattarini
2012-11-25 17:44         ` Eric S. Raymond
2012-11-25 11:25     ` Nguyen Thai Ngoc Duy
2012-12-11  5:44       ` Patrick Donnelly
2012-12-12  0:09         ` Sitaram Chamarty
2012-12-12  0:28           ` Patrick Donnelly
2012-12-12  0:53           ` Tomas Carnecky
2012-12-12  1:50             ` Nguyen Thai Ngoc Duy
2012-12-12  2:22               ` Tomas Carnecky
2012-12-12  2:26               ` Patrick Donnelly
2012-12-12  5:15                 ` Joshua Jensen
2012-12-12  3:30           ` Eric S. Raymond
2012-12-12  5:11             ` Joshua Jensen
2012-12-12 12:23               ` Eric S. Raymond
2012-12-12  6:32             ` Jeff King
2012-12-12  7:03               ` Patrick Donnelly
2012-12-12  8:32                 ` Jeff King [this message]
2012-12-12 12:26               ` Eric S. Raymond
2012-12-12 12:29                 ` Jeff King
2012-12-12 17:49               ` Junio C Hamano
2012-12-12 22:21                 ` Andrew Ardill
2012-12-12 22:43                   ` Junio C Hamano
2012-12-12  7:11             ` Patrick Donnelly
2012-12-12 12:43               ` Eric S. Raymond
2012-12-19  2:30                 ` Patrick Donnelly
2012-11-25 11:40     ` Felipe Contreras
2012-11-25 17:36       ` Eric S. Raymond
2012-11-25 21:25         ` Felipe Contreras
2012-11-25 22:11           ` Eric S. Raymond
2012-11-26 13:17             ` Felipe Contreras
2012-11-27 14:35       ` Magnus Bäck
2012-11-27 18:35         ` Eric S. Raymond
2012-11-27 21:08           ` Sitaram Chamarty
2012-11-28  0:16           ` Felipe Contreras
2012-12-03 21:45             ` Philippe Vaucher
2012-12-04 14:19               ` Felipe Contreras
2012-12-04 14:40                 ` Stephen Bash
2012-11-28  0:10         ` Felipe Contreras
2012-11-28  0:51           ` Jeff King
2012-11-28  1:22             ` Felipe Contreras
2012-11-28  1:39               ` Jeff King
2012-11-28  2:06                 ` Felipe Contreras
2012-11-28 15:39           ` Magnus Bäck
2012-11-28  5:08     ` Joshua Jensen
2012-11-25  8:57 ` Johannes Sixt
2012-11-25 10:25   ` Eric S. Raymond
2012-11-25 21:41 ` Krzysztof Mazur
2012-11-25 22:47   ` Eric S. Raymond
2012-11-26  5:10     ` Sitaram Chamarty
2012-11-26  8:32       ` Krzysztof Mazur
2012-12-04 15:51 ` Martin Langhoff

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=20121212083210.GB18322@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=batrick@batbytes.com \
    --cc=esr@thyrsus.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --cc=sitaramc@gmail.com \
    /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.
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 NNTP newsgroup(s).