Python -> C++ compilation

Roman Suzi rnd at onego.ru
Sun May 27 13:13:28 EDT 2001


On 27 May 2001, Martin von Loewis wrote:

Thanks a lot, Martin!

I've not thought there are 3 possible solutions to this.
However:

>The basic question is why you'd want to have such a thing. To make a
>stand-alone executable? Use freeze, or the installer. To gain
>execution speed? In your typical Python program, much execution speed
>can be gained with small modifications - although those modifications
>are often hard to find. Because it's cool? That certain was the
>primary motivation for the two IPC authors. Because you could sell it
>for a lot of money? Dunno, you may ask Andreas Otto about that.

Let me explain. Python programming is too easy to consider C++
for doing most work. However, if one is _forced_ to use C++
because the project is being developed with it, there are 5 options:

0. Convince management on using Python (see #3 also)
1. Write in Python then automatically compile into C++ using some
tool
2. Write Python program for C++ code generation
3. Embed Python (not easy even though Python is Free!) and have fun
4. Give up Python

My question was theoretical (at my current job we use Python
with pleasure). But what-if... always remains.
It's too easy to get accustomed to good and elegant things,
you know.

I myself have pulled trick #2 for markup-languages four times already.
No doubt, it will work for C++ too ;-)

>Regards,
>Martin

Thanks for your input!

Sincerely yours,
Roman Su
zi





More information about the Python-list mailing list