On Fri, 2009-01-02 at 14:50 -0500, Eric S. Raymond wrote: > Mark de Wever <ko...@xs4all.nl>: > > 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. > > 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. > > > 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.
Realistically, Python can have memory leaks: if you no longer use an object, but forget to kill a variable that refers to it, in practice that is a leak. It might not happen as often as memory leaks in a C program, but I think it will happen *more* often than memory leaks do using the C++ RAII approach we use on Wesnoth. We have had very few problems with memory leaks in Wesnoth's history. However, I do agree that avoiding undefined behavior -- heap corruption and so forth -- is a big advantage of Python. > > > > That's the discussion we're having now, isn't it? > > > > I just like to discuss first whether we want it and whether to code > > looks good before planning how to integrate it. > > Right. That's why I started this thread. > > > > > Some other concerns I have: > > > > Is Python available on all platforms we support. > > > > > > Answer: Yes. We know this from experience with the Python AIs. > > > > We don't know, since the Python AI can be disabled. > > It is my understanding that at least one mainline campaign breaks if you > do that. So it seems unlikely that anyone is actually doing this, or we'd > be getting bug reports about it. > > > We had some problem with certain people still using Python 2.3 with some > > Python AI changes IIRC Blind Oracle wanted to make. > > Must have been before my time. > > > > 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. _______________________________________________ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev