兼有C的效率和Python的优美:Cython
jopen
11年前
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.