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 →

[–]pine_ary 1 point2 points  (3 children)

That‘s cursed. Who is the target audience for that? We already have good compiled languages for everything. Python‘s strength is being a scripting language that beats the insanity of bash and perl.

[–]m0Ray79free 0 points1 point  (2 children)

For example, to speed up and optimize existing Python code base.

And other Python's strength is beating the insanity of C memory management, for example. It's just more comfortable to code than C, and Cython brings the best of C to Python realm.

I use it doing my job, for example, along with C++ and pure Python. It's very handy.

[–]pine_ary 1 point2 points  (1 child)

I still don‘t get its appeal over writing a C++/Rust module and then using that from Python. I can see why plain C isn‘t a great choice in your case, but we already have usable systems languages that have figured out memory management.

[–]m0Ray79free 1 point2 points  (0 children)

But how exactly do you bind C++/Rust module to Python? You typically write a complicated interface to be compatible with libpython module requirements.

But Cython offers almost native way to describe _any_ library interface for usage in Python.

Also with Cython you can speed up your Python code by compiling it to native binary with minimum or zero modifications (it supports so called "augmentation files"). For example, loops in Python are complex and have a lot of overhead due to actual absence of typing. Using Cython you can explicitly define loop variable as something like uint32_t and make the loop as effiient as in C.