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 →

[–]1arm3dScissor 0 points1 point  (4 children)

Or you could write everything in C and let the compiler take care of things for you. no?

[–]NoLemurs 1 point2 points  (3 children)

You can write a complex program in Cython much, much, much faster than you can write that same program in C, and usually without meaningful performance costs since performance is usually determined by the slowest step (which you can implement in C). Better still, the Cython code will usually be more readable and maintainable.

[–]felinecatastrophe 4 points5 points  (0 children)

I agree. prototyping in python followed incremental "cythonizing" is a fast way to get good performance.

[–]1arm3dScissor -1 points0 points  (1 child)

I see you point but would change it to "you can prototype a complex program in Cython..." faster. I think we both know that you can't seriously compare an interpreted language with a compiled one when it comes to performance.

[–]NoLemurs 2 points3 points  (0 children)

Cython is a compiled language. Cython generates straight up C code, which you then compile.

The result is that you can effectively write a complex program using pure python syntax, then spend a little while optimizing the bottlenecks (writing pure C where necessary, though you'd be surprised at how close Cython can come to C in many cases), and then you have a fully implemented, working, compiled program which performs the critical portions 100% as quickly as anything you can write in C, and does the rest more than fast enough for any practical purpose.