Nuitka — A Python Compiler
kayhayen24x7.homelinux.org
Nuitka — A Python Compiler
1–10 of 34 posts
Re: Nuitka — A Python Compiler
#2The generated C++ source contains the following comment:
// This code is in part copyright Kay Hayen, license GPLv3. This has the consequence that // your must either obtain a commercial license or also publish your original source code // under the same license unless you don't distribute this source or its binary.
Re: Nuitka — A Python Compiler
#3The licence (GPLv3) limits its use a bit - at least for people who prefer other licences like BSD or MIT. The generated C++ source contains the following comment: // This code is in part copyright Kay Hayen, license GPLv3. This has the consequence that // your must either obtain a commercial license or also publish your original source code // under the same license unless you don't distribute this source or its bina…
Re: Nuitka — A Python Compiler
#4Did anybody else notice the large number of compilers/interpreters/tools built for python in comparison to many other languages out there? I think it might partly be the advantage of having an easy to parse language with well defined semantics.
Re: Nuitka — A Python Compiler
#5The licence (GPLv3) limits its use a bit - at least for people who prefer other licences like BSD or MIT. The generated C++ source contains the following comment: // This code is in part copyright Kay Hayen, license GPLv3. This has the consequence that // your must either obtain a commercial license or also publish your original source code // under the same license unless you don't distribute this source or its bina…
I'm confused by this. I thought the license used by a compiler had no effect on the licenses that could be used for programs compiled by it. If the author of Nuitka is claiming that software compiled by Nuitka is in fact a derivative work of Nuitka, that is indeed very problematic.
This is all way out of my area of expertise, so take it with a grain of salt.
Re: Nuitka — A Python Compiler
#6Re: Nuitka — A Python Compiler
#7Re: Nuitka — A Python Compiler
#8 import math
num_primes = 0
for i in xrange(2, 500000):
if all(i % j for j in xrange(2, int(math.sqrt(i)) + 1)):
num_primes += 1
print num_primes
Here's the code above translated to C++ by Nuitka: http://pastebin.com/41ueyTEB # CPython 2.6.6
$ time python hello.py
41538
real 0m6.377s
user 0m6.350s
sys 0m0.020s
# Nuitka & g++-4.5
$ time ./hello.exe
41538
real 0m4.573s
user 0m4.270s
sys 0m0.300sRe: Nuitka — A Python Compiler
#9The problem, in general, isn't that Python and languages like it don't have a compiler, it's that the semantics of the language are hostile to good performance by traditional means of compilation. To do what the programmer requests requires doing things at runtime that are hard to make fast. That's why things like tracing JITs are being used for things like JavaScript.
The speedup you get from actually compiling Python programs is because the CPython interpreter is pretty awful, not because compilation is a magic solution to performance problems. The IronPython guy gave a nice explanation of this at OOPSLA 2007's Dynamic Languages Symposium - maybe things have changed in CPython since then.
Re: Nuitka — A Python Compiler
#10I sometimes see people ask about translating a language like Python to Common Lisp (or another language that can be compiled) as a kind of optimization. The problem, in general, isn't that Python and languages like it don't have a compiler, it's that the semantics of the language are hostile to good performance by traditional means of compilation. To do what the programmer requests requires doing things at runtime th…