git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Python extension commands in git - request for policy change
@ 2012-11-25  2:44 Eric S. Raymond
  2012-11-25  3:15 ` Nguyen Thai Ngoc Duy
                   ` (4 more replies)
  0 siblings, 5 replies; 82+ messages in thread
From: Eric S. Raymond @ 2012-11-25  2:44 UTC (permalink / raw)
  To: git

git presently contains one Python extension command, Pete Wycoff's p4
importer.  If my git-weave code is merged it will acquire another.  
I think we can expect more submissions of Python extensions in the
future, for two good reasons:

1. Python has a much richer type ontology than shell; there are many
things this makes relatively easy that are quite painful in shell.

2. While Perl shares advantage #1, compared to Python it's a
maintainability mess - much more difficult to read 6 months later.

On the other hand, 

3. Attitudes in the git dev group seem to be influenced by a
perception that up-to-date Python versions are not as reliably present
on our target platforms as Perl is.

4. Python has the disadvantage that comes with robust growth; you have
to specify "version x.y or later" as a dependency, mainly because new
modules keep getting getting folded into the stock Python environment.

Previous conversation on the list suggests that there has been a tacit
policy of managing these problems by (a) discouraging (though not entirely
forbidding) Python extensions, and (b) requiring extension submitters to
document some dependency on language version.

I think this is suboptimal.  By not forbidding the Python language
entirely, we guarantee having to deal with problems 3 and 4 anyway -
but by discouraging it, we're buying significant long-term
maintainability costs. It especially disturbed me to hear of Python
commands being recoded in C - that is definitely not the right
direction for reducing expected defect counts, if only because of
memory-management issues.

We're behind the best-practices curve here.  The major Linux
distributions, which have to deal with almost the same set of
tradeoffs we do, went to Python for pretty much all glue and
administration scripts outside /etc a decade ago, and the decision has
served them well.

That, among other things, means up-to-date versions of Python are
ubiquitous unless we're looking at Windows - in which case Perl and
shell actually become much bigger portability problems.  Mac OS X 
has kept up to date, too; Lion shipped 2.7.1 and that was a major
release back at this point.

To be fair, there was a time when being a bit twitchy about Python
version skew and deployment breadth was justified, but I believe that
time is now well past us. My basis for believing this is very simple -
I maintain a lot of Python code for systems programmers with stiff
portability requirements (things like reposurgeon, coverity-submit,
freecode-submit, shipper, and the Python tools in gpsd). I know what
kinds of bug reports I get and what kinds I don't, and in the last
few years "this breaks on my Python version" has gone from unusual
to doesn't-happen.

I think my experience with gpsd is particularly instructive.  Like
git, that project has a C core with Python wrappers and extension 
components. Like git, it gets deployed in a lot of odd places by people
who cannot afford the time to be tolerant about cross-platform
problems and are quite willing to hit the maintainer with a clue-bat
when they encounter them.  The good news is - they don't have to.

I should also point out that none of Mercurial's problems seem to
have anything to do with the fact that it's written in Python...

I think we can choose a better policy based on some simple premises.

1) In 2012, we can specify a "floor" Python version of 2.6 (shipped in
2008) and be pretty much guaranteed it will be anywhere we want to
deploy except Windows.  Windows will remain a problem because Python
isn't part of the stock install, but that's an equal or worse problem
for shell and Perl - and at least the Python project ships a binary
installer for Windows.

2) Python extension commands should test the Python version on startup
and die loudly but gracefully in the rare case that they don't find
what they need.

3) We should be unconditionally be encouraging extensions to move
from shell and Perl to Python.  This would be a clear net gain is
portability and maintainability.

4) We should be encouraging C code to move to Python, too.  There's
little gain in portability on this path because modern C has cleaned
up its act a lot, but the drop in expected bug loads would be well
worth the porting effort.  Segfaults are not your friend, and the x2 to
x5 drop in line count would do very good things for long-term
maintainability.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Live free or die; death is not the worst of evils.
	-- General George Stark.

^ permalink raw reply	[flat|nested] 82+ messages in thread

end of thread, other threads:[~2012-12-19  2:35 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).