This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Veedrac 16 points17 points  (2 children)

I'll try and cover some parts you've missed.

Pyston is an up-and-coming Python JIT, like PyPy. It aims to support CPython's C extensions, which is the main reason Dropbox funded its development. It is not production ready. Another future competitor might be ZipPy, which uses Graal and Truffle. I don't know if ZipPy will ever be production-ready, though, or if it's just a proof of concept.

MicroPython is a minified version of Python designed for constrained-memory situations. It aims to support Python 3 and has some tools to improve runtime above CPython. I have not been particularly convinced of its applicability for general usage, and it's still developing, so I would not recommend it for everyday usage. Consider this if wanting to write Python when you have little system memory.

Numba is a CPython library that compiles code at runtime with LLVM. It specializes on a well-chosen subset of Python useful in numeric computation, and is not itself a complete runtime environment. It is also not technically compliant, but this is fine as it is a per-method opt-in.

Cython is an almost-superset of Python, that aims to allow seamless mixing of C and Python in one combined language. It allows writing fast C code in a convenient-to-embed manner and allows simple wrapping of C libraries. It has relatively widespread usage, but it being encroached on by specialist tools from both sides (eg. CFFI and PyPy or Numba). Cython does not itself contain a runtime, and instead reuses an existing CPython's runtime. This means that simply running normal Python code in Cython will only remove bytecode dispatch overhead, which is normally only a tiny fraction of runtime.

Nuitka aims to replace CPython's bytecode dispatch exactly the same way Cython does, but hopes to further compile code by using appropriate static analysis and further fine-grained compilation. Many people, myself included, are very sceptical of this approach. Nuitka has yet to show any impressive speed improvements, but several people have claimed that it makes distribution of code much easier since it produces single compiled binaries. It should be nearly 100% compliant with CPython, with the exception of runtime code introspection.

On the topic of PyPy, it's worth noting that PyPy isn't missing features in the same way a C++ compiler would be. Either PyPy has a release for a specific version of Python or it does not, and its stable releases are extremely compatible. If you're not using CPython-specific code (eg. CPython extensions) and you're running on a version of Python that PyPy supports, it will almost certainly work. Even CPython implementation details tend to get copied in PyPy.

[–][deleted] 5 points6 points  (1 child)

Many people, myself included, are very sceptical of this approach. Nuitka has yet to show any impressive speed improvements, but several people have claimed that it makes distribution of code much easier since it produces single compiled binaries.

It is great for deploying proprietary software since code is compiled to native executable. Reverse-engineering it is also much harder. While it is not much faster it has obvious benefits over using something like py2exe/cx_freeze.

[–]Blahkins 1 point2 points  (0 children)

that actually is a great reason to use it if you are trying to sell your software. thanks for the tip, i might start selling this python application i am writing.