Using python for _large_ projects like IDE

Stephan Deibel sdeibel at wingide.com
Mon Jan 19 12:38:49 EST 2004


On Mon, 19 Jan 2004, Eric Brunel wrote:
> > I am a little experienced python programmer (2 months).  I am somewhat
> > experienced in C/C++.  I am planning (now in design stage) to write an
> > IDE in python.  The IDE will not be a simple one.  I had an idea of
> > writing the IDE in C/C++, as it is a big project, bcoz of the
> > following
> > 
> > 1. if python is used, then the memory required for running the IDE
> > will be high.
> 
> It's quite hard to tell, since I've never seen anybody writing a significant 
> application *both* in C/C++ and Python to compare their memory usage... I'd say 
> memory usage depends a lot more on the design than on the language used. Python 
> does introduce an extra cost in memory consumption, but the larger the 
> application, the less you'll notice it.

Actually, I've done a little of this in areas where Python was too slow or
memory intensive, by first writing in Python and then rewriting in C or
C++ (so I briefly had two implementations of the same thing).

You can do things in Python to reduce memory consumption and increase
speed, and you can recode select portions in C/C++ also, and which you
choose depends on the code, situation, requirements, etc.  Similarly,
whether memory usage is significantly greater in Python depends on what
you're doing.

The best approach is to write in pure Python and recode on select *small
as possible* parts in C/C++.  I started by doing whole modules and quickly
found out that minimizing the size of the C/C++ code base is better than
having whole modules in one or the other.  The ability to integrate back
and forth is good enough that this is quite doable.

> > Are there any ways to forsee the performance critical parts? > 
> I really think you shouldn't care; remember, "premature optimization is the root 
> of all evil" ;-)

Absolutely:  Use a profiler, not your brain, to find the parts that are
problems and need to be converted!

Stephan Deibel

--
Wing IDE for Python
Archaeopteryx Software, Inc
Take Flight!

www.wingide.com




More information about the Python-list mailing list