py2c - an open source Python to C/C++ is looking for developers

M

maniandram01

I created py2c ( http://code.google.com/p/py2c )- an open source Python to C/C++ translator!
py2c is looking for developers!
To join create a posting in the py2c-discuss Google Group or email me!
Thanks
PS:I hope this is the appropiate group for this message.
 
A

andrea crotti

2012/7/30 said:
I created py2c ( http://code.google.com/p/py2c )- an open source Python to C/C++ translator!
py2c is looking for developers!
To join create a posting in the py2c-discuss Google Group or email me!
Thanks
PS:I hope this is the appropiate group for this message.

It looks like a very very hard task, and really useful or for exercise?

The first few lines I've seen there are the dangerous * imports and
LazyStrin looks like a typo..

from ast import *
import functools
from c_types import *
from lazystring import *
#constant data
empty = LazyStrin
ordertuple = ((Or,),(And
 
M

MaxTheMouse

I created py2c (http://code.google.com/p/py2c)- an open source Python to C/C++ translator!
py2c is looking for developers!
To join create a posting in the py2c-discuss Google Group or email me!
Thanks
PS:I hope this is the appropiate group for this message.

Out of curiosity.
What is the difference between this and Shedskin? Shedskin being a
(restricted) python-to-C++ compiler. (http://code.google.com/p/
shedskin/) Is the goal to be able to handle any python code or a
subset?

Cheers,
Adam
 
S

Stefan Behnel

alex23, 31.07.2012 02:16:
There's also Nuitka, which is an unrestricted compiler, I believe:
http://nuitka.net/pages/overview.html

Not to forget Cython, which is the only Python-to-C compiler that is in
widespread use.

Is this a completely independent project, or are there plans to
leverage off of PyPy's toolchain, for example?
From a look at the source code, it seems hard to bring it together with
anything. It looks very monolithic.

Stefan
 
S

Stefan Behnel

Stefan Behnel, 31.07.2012 07:23:
From a look at the source code, it seems hard to bring it together with
anything. It looks very monolithic.

Hmm, sorry, I mixed it up with "2c.py", which is yet another of those
Python-to-C compilers with an all too similar name.

https://code.google.com/p/2c-python/

There are a couple of others here:

http://wiki.python.org/moin/PythonImplementations

Seeing the number of those compilers, almost none of which is commonly used
and/or still alive as a project, the question really is: why another one?

I mean, it's totally fine as a hobby educational project, sure, and I
really don't want to discourage anyone from going through this to have fun.

But apart from "just for fun", what is the goal that would make this
particular compiler different from the others? And also different enough to
merit its own source base, instead of basing it on one of the existing
projects? I don't consider "source is harder to read than to write" a good
answer to this in general.

Stefan
 
R

Ramchandra Apte

Stefan Behnel, 31.07.2012 07:23:





Hmm, sorry, I mixed it up with "2c.py", which is yet another of those

Python-to-C compilers with an all too similar name.



https://code.google.com/p/2c-python/



There are a couple of others here:



http://wiki.python.org/moin/PythonImplementations



Seeing the number of those compilers, almost none of which is commonly used

and/or still alive as a project, the question really is: why another one?



I mean, it's totally fine as a hobby educational project, sure, and I

really don't want to discourage anyone from going through this to have fun.



But apart from "just for fun", what is the goal that would make this

particular compiler different from the others? And also different enough to

merit its own source base, instead of basing it on one of the existing

projects? I don't consider "source is harder to read than to write" a good

answer to this in general.

It converts to *pure* C/C++ *without* using Python or its API so that it can be the same speed as C/C++
 
R

Ramchandra Apte

Stefan Behnel, 31.07.2012 07:23:





Hmm, sorry, I mixed it up with "2c.py", which is yet another of those

Python-to-C compilers with an all too similar name.



https://code.google.com/p/2c-python/



There are a couple of others here:



http://wiki.python.org/moin/PythonImplementations



Seeing the number of those compilers, almost none of which is commonly used

and/or still alive as a project, the question really is: why another one?



I mean, it's totally fine as a hobby educational project, sure, and I

really don't want to discourage anyone from going through this to have fun.



But apart from "just for fun", what is the goal that would make this

particular compiler different from the others? And also different enough to

merit its own source base, instead of basing it on one of the existing

projects? I don't consider "source is harder to read than to write" a good

answer to this in general.

It converts to *pure* C/C++ *without* using Python or its API so that it can be the same speed as C/C++
 
M

Michael Torrie

It converts to *pure* C/C++ *without* using Python or its API so that it can be the same speed as C/C++

Sounds like a fun project for you. I hope you learn a lot doing it.
That's reason enough for it. Do you plan to port all the standard
python modules as well, though? Because Python modules, both in the
standard library and third-party, are the main reasons that I use
python. For example, PyGTK. Python is a great glue language. Since it
can seamlessly interact with C and be extended in C, speed has never
really been an issue for me.
 
R

Ramchandra Apte

That's reason enough for it. Do you plan to port all the standard
python modules as well, though?

Well, it should be quite easy because most of the _modules are either C accelerator (which there is no need to port) or a C wrapper (which should be trivial to port)
 
R

Ramchandra Apte

That's reason enough for it. Do you plan to port all the standard
python modules as well, though?

Well, it should be quite easy because most of the _modules are either C accelerator (which there is no need to port) or a C wrapper (which should be trivial to port)
 
R

Ramchandra Apte

Sounds like a fun project for you. I hope you learn a lot doing it.

That's reason enough for it. Do you plan to port all the standard

python modules as well, though? Because Python modules, both in the

standard library and third-party, are the main reasons that I use

python. For example, PyGTK. Python is a great glue language. Since it

can seamlessly interact with C and be extended in C, speed has never

really been an issue for me.

I am writing py2c for my OS written in Python (planned) .
Sounds like a fun project for you.
More fun with more developers. (I need developers)
 
R

Ramchandra Apte

Sounds like a fun project for you. I hope you learn a lot doing it.

That's reason enough for it. Do you plan to port all the standard

python modules as well, though? Because Python modules, both in the

standard library and third-party, are the main reasons that I use

python. For example, PyGTK. Python is a great glue language. Since it

can seamlessly interact with C and be extended in C, speed has never

really been an issue for me.

I am writing py2c for my OS written in Python (planned) .
Sounds like a fun project for you.
More fun with more developers. (I need developers)
 
S

Stefan Behnel

Ramchandra Apte, 02.09.2012 08:10:
python modules as well, though?

Well, it should be quite easy because most of the _modules are either C accelerator (which there is no need to port) or a C wrapper (which should be trivial to port)

Nope, not at all. They use the CPython C-API internally, so in order to
port them, you'll have to reimplement that first. That's a huge amount of
work, as proven by the incompleteness of all other Python implementations
in that regard. If you think you can do better here then IronPython or
PyPy, please go ahead.

Stefan
 
M

Mark Lawrence

I am writing py2c for my OS written in Python (planned) .
More fun with more developers. (I need developers)

Your earlier quote "Well, it should be quite easy because most of the
_modules are either C accelerator (which there is no need to port) or a
C wrapper (which should be trivial to port)" means that I won't be
touching the project with a 10 foot long disinfected barge pole.
 
R

Ramchandra Apte

How is it implemented long integers?

py2c has been just started (long integer multiplacation might use the Python internal multiplication code) (it uses the karatsuba algorithm)
 
R

Ramchandra Apte

How is it implemented long integers?

py2c has been just started (long integer multiplacation might use the Python internal multiplication code) (it uses the karatsuba algorithm)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top