Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] Re: Python?
Home

[Freeciv-Dev] Re: Python?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Brandon J. Van Every" <vanevery@xxxxxxxxxxxxxxxxxxx>
Cc: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Python?
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Sat, 20 Dec 2003 23:23:02 -0600

On Fri, Dec 19, 2003 at 03:09:02PM -0800, Brandon J. Van Every wrote:
> In my own project vision (not necessarily yours), I'm not sure I see
> why.  My assumptions:
> - for the moment, I'm only talking about Python code submissions
> - the submitter has to provide a few informational stubs in their code
> - if they don't, their code simply isn't enableable
> - sure it's fat in the distro, but that could be cleaned occasionally,
> or even by an automated tool that validates enableability.

What you have is a receipe for total disaster.  If you want to eliminate
C as much as possible, and have Python code submitted in the above way
only, then you have ceased to have any coherent idea of what FreeCiv is.
Incompatible extensions will float about everywhere, none really working
with each other, and effective development will grind to a halt.

> of cake in Python, and I want to discourage people from writing new C
> code.  The point would be to migrate from C to Python, atrophizing the C
> until only a core of absolutely essential performance components
> remains.  Those I think should be handled "more traditionally," not by a
> we'll-take-anything process.

I doubt FreeCiv has any performance components that would be
unacceptably slow in Python.  I also doubt that rewriting huge volumes
of code in Python would be worth the effort.

You can't just convert piecemael -- at least not with a good result.
Say you implement whizbang feature X.  It touches 10 C functions and
adds two new ones.  OK, no new C code, right?

So you are forced to convert those 10 functions to Python right away
(putting a high barrier to entry to anyone wanting to add a feature --
they not only have to know both C and Python, but also how to link the
two!).  Now, lots of C code uses those 10 functions, so you can't really
make them any different, and they still have to be callable from C.  So
your Python code will wind up looking pretty similar to your C code,
since you are forced to use the same structure and can't adjust it to
use any of Python's OO features.

The net result: improvements stagnate, and if you ever do get most of it
written in Python, it'll be no better than C because it's all still
written to be callable and usable from C.  You'll still have a major
rewrite on your hands to really derive any benefit from Python.

Have you ever actually glued C and Python together?  Please show us some
code.  It seems you are advancing ideas that have no bearing in
practical reality.

-- John



[Prev in Thread] Current Thread [Next in Thread]