Python to C converter

13 views
Skip to first unread message

praveenk...@gmail.com

unread,
Jun 5, 2006, 7:13:58 AM6/5/06
to
Hi All,

I have an application return in python. I want this to be
converted to C. I will be kind enough if somebody suggest is there any
tool or compiler to do that.

Regards-
Praveen Kumar A.S

Rene Pijlman

unread,
Jun 5, 2006, 7:52:00 AM6/5/06
to
praveenk...@gmail.com:

>I have an application return in python. I want this to be
>converted to C.

http://www.python.org/doc/faq/general/#can-python-be-compiled-to-machine-code-c-or-some-other-language

--
René Pijlman

gene tani

unread,
Jun 5, 2006, 9:16:29 AM6/5/06
to

http://pyfaq.infogami.com/can-python-be-compiled-to-machine-code-c-or-some-other-language
shd probably mention Shedskin, boost, ctypes, any others?

Fuzzyman

unread,
Jun 5, 2006, 10:19:39 AM6/5/06
to

The PyPy LLVM backend will compile Python code to C.

Also Pyrex can do a bit more than just integrate C with Python, AFAIK
it *can* compile some Python to C - although with very little speed
advantage if you don't use native C types.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

Paul Boddie

unread,
Jun 5, 2006, 11:01:48 AM6/5/06
to
gene tani wrote:
> http://pyfaq.infogami.com/can-python-be-compiled-to-machine-code-c-or-some-other-language
> shd probably mention Shedskin, boost, ctypes, any others?

I've added a comment, which is seemingly all that can be done right now
on that page. See also this overview I wrote about Python and attempts
at compilation/translation:

http://groups.google.co.uk/group/comp.lang.python/msg/51785816bf5de6b1

Paul

Chance Ginger

unread,
Jun 5, 2006, 7:22:01 PM6/5/06
to
If you are looking for a "real" python to C, well in this case
C++ look for the shedskin compiler. It will take a rather
nice subset of Python and generate C++ code from it.

It is still rather experimental but I have been using it.

Chance G.

Carl Friedrich Bolz

unread,
Jun 7, 2006, 1:13:27 PM6/7/06
to pytho...@python.org
Chance Ginger wrote:
> If you are looking for a "real" python to C, well in this case
> C++ look for the shedskin compiler. It will take a rather
> nice subset of Python and generate C++ code from it.


In which sense is shedskin a more "real" python to C/C++ compiler than
some of the other mentioned projects? As most of the others (PyPy,
Pyrex), Shedskin works only for a small number of Python programs that
don't mix types too wildly.

BTW: While the RPython (the subset of the Python language that PyPy can
compile) might not be extremely advanced, using it gives you a number of
very interesting features: like having the resulting program been
enhanced to not use the C stack (for deeply recursive code), using
different garbage collection strategies...

Cheers,

Carl Friedrich Bolz

Chance Ginger

unread,
Jun 7, 2006, 3:38:18 PM6/7/06
to
Isn't Pyrex for writing extensions to Python? As for PyPy, I
didn't scroll down far enough to see the compiler info. It
does say it is Python written in Python at the top.

Shedskin is nothing but a compiler.

Reply all
Reply to author
Forward
0 new messages