On Fri, Jan 02, 2009 at 02:50:02PM -0500, Eric S. Raymond wrote: > Mark de Wever <[email protected]>: > > Can be expected yes, but I'm sure there are several players who are also > > C++ coders and do not contribute. We hoped by allowing AIs to be written > > in Python we would attract more people who wanted to help writing AIs > > and that was no big success. > > I think Sergei Popov has answered this one. > > > > Actually, I lied. It was more like two days :-). Read my detailed > > > account > > > here: http://www.linuxjournal.com/article/3882 > > > > Sorry but I can't believe you were as efficient in Python as in C after > > just 2 or 4 days of coding. > > Read the article. In C, the central technique I used (the metaclass > hack) would have been impossible. So there's a serious argument that > Python made me far *more* productive than I could have been in C > during that two days.
When I first started Perl I was also more productive as in Delphi in a few hours due to the regex in Perl. This didn't mean I mastered Perl at that point. > Since you press the point, I'll admit that I don't actually expect > most programmers could learn to write Python so productively in two > days - I am exceptionally talented and experienced in relevant ways, > and that was high performance even for me. Nevertheless, I think it > is reasonable to expect programmers with normal ability to achieve > parity with C in a week to ten days of steady practice. I didn't say you can work and start to do small things in Python in a few days, but Wesnoth is not small and in order to make larger changes you need to be quite familiar with both the language and the project you work on. Most of the time I can also do things in a new language in a few days, but that doesn't mean I think I master that language. Python is rather big including its library. The documentation shipped with Python will take quite some to read and IMO in order to master a language you should be quite familiar with its default library as well. Also every programming language has it's own idioms, which you most of the time only learn by reading code of more skilled developers in that language or read books on that language. My problem is that nowadays a lot of people think you can learn foo in 21 days and master it in that time. Learning something costs time and practice. Telling people you can master Python in less then two week only increases that believe, that's my problem with the statement you can learn Python in 4 days. It's not against Python but against the general idea that you can learn a craft in a very short time. > > Memory leaks in C++ can also be detected by valgrind. Your argument was > > that with Python there would be no memory leaks. > > In pure Python, zero memory leaks, yes. That had been true ever since > the garbage collector was enhanced to scavenge circular structures. > You changed the subject a bit by bringing in reference leaks in the > C++ bindings. Really the class of errors I had in mind when I said > "never" was wild-pointer and aliasing bugs. Yes but we're now looking at combining Python with C++. That means we have to do the reference counting which can cause bugs. Of course we can use the RAII approach for that in C++ but that's the same way we approach resources in C++ as well. > > > 3.x really is a disruptive change, but 2.x will be maintained and > > > supported for the foreseeable future on our target platforms. > > > > I'm more concerned with us having to maintain two versions of some code > > due to incompatibilities. > > That's a legitimate thing to be worried about. But I don't think it > could be worse than what we already cope with routinely for things > like GCC-vs.-MSVC differences. We had quite some MSVC 6 issues, since that compiler was released before the C++ standard and thus not fully honoured the C++ standard. That compiler is no longer supported so we don't have that problem anymore. The other problem we still have at times is that we sometimes write code which contain some bugs. GCC seems to be more forgiving in this case (I won't delve in the details why) so we get problems on MSVC again. But these are our bugs and not compiler specific problems. This means we don't have a lot of ifdefs for different compilers in Wesnoth at the moment, which I fear we might have to do to support multiple Python versions. -- Regards, Mark de Wever aka Mordante/SkeletonCrew _______________________________________________ Wesnoth-dev mailing list [email protected] https://mail.gna.org/listinfo/wesnoth-dev
