From: Ari H. <ahe...@an...> - 2000-12-13 00:20:43
|
On Tue, 12 Dec 2000, Dethe Elza wrote: > I'm curious why VPython is written as a C-extension, rather than on top of > pyOpenGL. Is it strictly a performance thing? Since pyOpenGL is already a > C-extension, the performance shouldn't be a problem, but that could be my > own ignorance speaking. I'm mainly curious because the more an extension > relys on C the less portable it becomes, and as a pedagical tool I prefer > Python code to C code. > It's a speed thing. The first couple of versions of Visual were written purely in Python, for ease of prototyping/modification. But when the interfaces were pretty well finalized, it was rewritten in C for speed. The performance issue is nothing other than that the core Python language is rather slow. There are a couple of features in Visual that were just very slow in the pure-Python version. That said, I don't see a) why Python should be more portable than C. Python is written in C. Beyond that, PyOpenGL relies on a working OpenGL implementation. Which is exactly what Visual needs (well, C++ really). I have yet to hear of the platform that had a working Python interpreter before it had a working C compiler. b) why it should matter "as a pedagogical tool" how Visual is implemented. If the internals were one extremely long PERL line, it shouldn't matter. The main thing is the friendly Python API. Ari Heitner |