兼有C的效率和Python的優美:Cython
Cython 是一門基于 Python 的編程語言, 通過額外的語法允許可選擇的靜態類型聲明。 它的目標是成為 Python 的超集, 而Python 賦予它高級,面向對象,函數式以及動態編程等特性。 使用 Cython 編寫的源代碼會被轉換成優化過的 C/C++ 代碼, 并且被編譯成 Python 的擴展模塊。 這樣即有非常快的程序執行速度和與外部C程序庫的緊密集成, 也可以保持 Python 語言所著稱的高程序員生產力。
Cython讓你能夠聯合Python 與 C 實現:
- write Python code that calls back and forth from and to C or C++ code natively at any point.
- easily tune readable Python code into plain C performance by adding static type declarations.
- use combined source code level debugging to find bugs in your Python, Cython and C code.
- interact efficiently with large data sets, e.g. using multi-dimensional NumPy arrays.
- quickly build your applications within the large, mature and widely used CPython ecosystem.
- integrate natively with existing code and data from legacy, low-level or high-performance libraries and applications.
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!