[BangPypers] converting python to assembly..
vsapre80 at gmail.com
Sat Jun 2 21:18:08 CEST 2012
On Sat, Jun 2, 2012 at 12:10 AM, Sriram Karra <karra.etc at gmail.com> wrote:
> On Fri, Jun 1, 2012 at 6:44 PM, Vishal <vsapre80 at gmail.com> wrote:
> > >
> > > a) "test.py" a very simple 1KB python file with a main function
> > > b) "_c_test.c" a 35KB file that is generated by 2c-py
> > >
> > > (b) gets generated by the following cmd line:
> > >
> > > > 2c-py -c test.py
> > >
> > > As you can see the 'c' file generated references python's internals.
> > > What I am looking for is something that would either create a
> > > equivalent in C or the ASM for the target microcontroller.
> OK; I understand. I wonder what the real point of 2c.py is. You start with
> a python source file, and end up creating a dll/so that can be imported as
> a python module in another python program? Obfuscation, I suppose. But a
> misleading name for a project, if there ever was one... Hm. Anyway,
> apologies for wasting your time.
I think the main point of doing a Python-to-C conversion followed by
creation of a dll which is re-imported into Python is performance.
Obfuscation is a by-product of this process. But if code-protection is more
paramount...it can be the considered the other way round too :)).
Anyways, if you have not looked, (and I hope you have) at Cython (
www.cython.org), I would urge you to take a look. Cython shines at doing
all of this and more in the most convenient way.
Time well spent is time enjoyed, and I enjoyed learning about 2c-py. Thanks
Please DONT print this email, unless you really need to. Save Energy &
Paper. Save the Earth.
More information about the BangPypers