Hacker News new | ask | show | jobs
by HerrMonnezza 2983 days ago
Does anyone know how this compares to existing Python-to-C++ transpilers like Cython or Shedskin?
1 comments

Cython is a bit different from CPython / Pythran / Shedskin in that you need to learn the Cython language, which is a Python-ish programming language, but not Python.

Shedskin and Pythran look somewhat similar to me (disclaimer: I've contributed quite a bit to Shedskin but have never used Pythran so far), except in Shedskin you don't even need annotations like with Pythran (the downside being the finer control you have of the native types used is through the transpiler options). Also, Shedskin development is not much active these days — to say the least — and there's zero support for Python 3, while Pythran is under fairly active development has beta support for Python 3.

If you're interested in Python / native implementations, you might be interested by Nuitka as well: http://nuitka.net/

Thanks for your answer!

However, I think this might be a bit misleading for people who do not know Cython:

> the Cython language, which is a Python-ish programming language, but not Python.

Actually, http://cython.org/ states:

""" The Cython language is a superset of the Python language that additionally supports calling C functions and declaring C types on variables and class attributes. """

In my experience with Cython, this description is quite accurate: code can be annotated with C types and then compiled to efficient C code by Cython; if you don't use annotations, then you can still compile to C code but with less speed advantage.

I haven't used Cython since version 0.17 (quite old now) but IIRC the major drawback was that it was mainly targeting writing extension modules for Python; it could generate self-standing executables, but would still require a Python interpreter to be embedded in any compiled code (that was the price for seamless interoperability between Cython/compiled code and "pure Python" code).

> Python-ish

It's a little more Python-like than just -ish.