Recent python -> native code compiler status (PyPy, Nuitka, Cython, Numba)?

709 views
Skip to first unread message

nick name

unread,
Nov 6, 2014, 6:46:10 AM11/6/14
to web...@googlegroups.com
I remember PyPy was able to run web2py apps in the past. Is this still the case?

Did anyone try to run web2py apps under Nuitka, Cython or Numba?

Was it successful? Was there an observable speed difference? Does any of them eventually let you pack the app in a native executable that does not include the source code of the app? (not even compiled byte code)

Niphlod

unread,
Nov 6, 2014, 8:15:36 AM11/6/14
to web...@googlegroups.com
pypy runs fine. It's one of our CI environments. As for other distribution, I really can't say anthing about. Just try it....

Leonel Câmara

unread,
Nov 6, 2014, 9:12:01 AM11/6/14
to web...@googlegroups.com
Does any of them eventually let you pack the app in a native executable that does not include the source code of the app? (not even compiled byte code)

Don't use python if you don't want to give out source code.

nick name

unread,
Nov 6, 2014, 9:32:12 AM11/6/14
to web...@googlegroups.com
On Thursday, November 6, 2014 4:12:01 PM UTC+2, Leonel Câmara wrote:
Does any of them eventually let you pack the app in a native executable that does not include the source code of the app? (not even compiled byte code)

Don't use python if you don't want to give out source code.

You might want to have a look at what nuitka and cython (and to a much lesser extent,  but still occasionally useful, shedskin) can do. Python code compiled through one of those is much hardware to decompile; not quite to the point of C++, but not very far.

Leonel Câmara

unread,
Nov 6, 2014, 10:26:28 AM11/6/14
to web...@googlegroups.com
Frankly I have no interest in making my code harder to decompile or not delivering the code, it's protected by copyright and usually I sell the costumer projects that they paid to develop so I find it ethically wrong not to give them the code. Besides, there aren't that many programmers willing to take reasonably sized projects they aren't familiar with and develop them, most programmers suck and can't read other people's code, they rather do it from scratch in joomla or something.  
  
I can see where it might be tempting not to give the code if you're selling licenses but, even then, again, you are protected by copyright and there's a long history of people giving out the code without any problems (for instance wordpress themes).

nick name

unread,
Nov 6, 2014, 7:27:03 PM11/6/14
to web...@googlegroups.com
On Thursday, November 6, 2014 5:26:28 PM UTC+2, Leonel Câmara wrote:
Frankly I have no interest in making my code harder to decompile or not delivering the code, it's protected by copyright and usually I sell the costumer projects that they paid to develop so I find it ethically wrong not to give them the code. Besides, there aren't that many programmers willing to take reasonably sized projects they aren't familiar with and develop them, most programmers suck and can't read other people's code, they rather do it from scratch in joomla or something.  
  
I can see where it might be tempting not to give the code if you're selling licenses but, even then, again, you are protected by copyright and there's a long history of people giving out the code without any problems (for instance wordpress themes).

While I generally agree with you, there is a project I'm considering right now in which, for reasons I will not discuss, it is more or less a requirement to make the source code unavailable until a later stage (1 year or so), at which point customer will receive the source code. I know that it is always possible to reverse engineer with enough effort - but specifically, in this project, I'm trying to make it easy for me to obfuscate and hard for an adversary to de-obfuscate and modify (to the point of being uneconomical).

I said "you might want to have a look" in the sense of "you are not up-to-date". I have only tried it on small pieces of software, but both Cython and Nuitka can start from lightly annotated / mostly unmodified Python code and produce native code that can be x1-x10 faster, and almost as hard to decompile as C++. At some point PyPy was also able to produce AOT-compiled native executables (based on type info seen during a specific run) but IIRC it's no longer the case.

Web2py is extremely dynamic, so I expect even if e.g. Nuitka can make it native, it won't be faster and still have enough clues to make decompiling much easier than C++. However, if it does work, it will be enough for my purposes for this project.

JorgeH

unread,
Nov 6, 2014, 8:44:51 PM11/6/14
to web...@googlegroups.com
I have to agree with 'nick name' here... there are some cases in which the developer wants to have control over the property of the code, at least until the client has paid.
Reply all
Reply to author
Forward
0 new messages