A short word ahead, since I'm quite busy to get things done for 1.6 I won't review the code Ivan wrote until after 1.6 has been shipped. The current code is >15.000 lines, which is huge to review. Which also means if we change to python most core devs need to relearn the code.
On Fri, Jan 02, 2009 at 10:19:26AM -0500, Eric S. Raymond wrote: > Sirp agreed in principle on IRC with moving the Wesnoth codebase > towards Python many months ago, basically in order to attract a larger > population of developers - because, even though Sirp doesn't > particularly *like* Python, he knows it's more accessible than C++. I think such a big move should be agreed by all current core devs and should be considered carefully. Why do you think Wesnoth will attract more developers if it's a Python project? > I will note for the record that though I personally *like* Python and > have come to dislike C++ intensely since learning it for Wesnoth, > these are not actually the reasons uppermost in my mind for wanting to > merge Illarionov's code. Nor is Sirp's reason. Here is how I view the > tradeoffs: I have worked with Python and to be honest I'm not really thrilled. My biggest problem with Python is the type safety. I had some code that 'compiled' without problem but at runtime it had a hard crash due to invalid types. This kind of problem doesn't happen in C++ since it won't compile. > The main reason to hesitate before moving core code to Python is that > it will require Wesnoth developers to know two languages before > working on the code. I do not view this as a major problem, as Python > is much easier to pick up than C++; I learned it in four days. I don't believe somebody can learn a new language and be fluent in it in four days. For a project as large as Wesnoth, one should be quite familiar with the language to code efficiently, which will take much longer as four days. > A lesser thing to worry about is performance. Python is an > interpreted language and relatively slow. Experience with Python AIs > has shown that this is not a blocker in practice, and machines > are still getting faster. Wesnoth runs on quite some smaller devices, which have less memory and much weaker CPU's so speed is a concern. > Python has two huge advantages over C++ that are relevant to defect > reduction, especially in a program like Wesnoth that does a lot of > tricky stuff with data structures: > > 1) No more memory-allocation screwups, *ever*. Python has no pointers > and is garbage collected; Python applications cannot core-dump. The > complex tangle of standard and local custom memory allocators we > presently use, and that are the source of so many of our bugs, will > be chopped away as we move to Python -- and good riddance. The Python bindings we currently use are ref counted, so if somebody fails there the garbage collection will fail and you still have a memory leak. > I think integrating Ivan's code should be our main project for > early in the 1.7 cycle. I am willing to take primary responsibility > for reviewing and merging; actually, I can't imagine a better use of > my project time than that. I suspect loonycyborg will be taking an > active role in the merge as well. I think we should review and decide whether we want to move to Python before discussing when to merge. Some other concerns I have: Is Python available on all platforms we support. Version dependency; Python has a new version every x months which often needs to change existing code. I know Python has tools to do that, but how can we support different versions of Python with one 'binary' without an ifdef hell. IMO we need to support several functions since most Linux distros ship different versions of Python. -- Regards, Mark de Wever aka Mordante/SkeletonCrew _______________________________________________ Wesnoth-dev mailing list [email protected] https://mail.gna.org/listinfo/wesnoth-dev
