
Cython () is a superset of the programming language Python, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of C.
via Wikipedia infobox
Cython: C-Extensions for Python
cython.org →Link to the official site · 28,636 chars · not written by Vinony
~7 min read
Cython () is a superset of the programming language Python, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of C.
Cython is a compiled language that is typically used to generate CPython extension modules. Annotated Python-like code is compiled to C and then automatically wrapped in interface code, producing extension modules that can be loaded and used by regular Python code using the import statement, but with significantly less computational overhead at run time. Cython also facilitates wrapping independent C or C++ code into Python-importable modules.
Cython translates Python code to C/C++ code, but additionally supports calling C functions and declaring C types on variables and class attributes. This allows broad to fine-grained manual tuning that lets the compiler generate very efficient C code from Cython code. This makes Cython the ideal language for wrapping external C libraries, and for fast C modules that speed up the execution of Python code. Cython has more than 70 million downloads per month on PyPI. You can support the Cython project via Github Sponsors or Tidelift . The original Pyrex program, which Cython is based on, was licensed "free of restrictions" (see below). Cython itself is licensed under the permissive Apache License . Started as a project in the early 2000s, Cython has outlived most other attempts at producing static compilers for the Python language. Numba , a Python extension that features a JIT compiler for a subset of the language, based on the LLVM compiler infrastructure (probably best known for its clang C compiler). It mostly targets numerical code that uses NumPy. mypyc , a static Python-to-C extension compiler, based on the mypy static Python analyser. Like Cython's pure Python mode , mypyc can make use of PEP-484 type annotations to optimise code for static types. Doc/About.html for a description of the language INSTALL.txt for installation instructions USAGE.txt for usage instructions Demos for usage examples
Excerpt from the source-code README · 6,028 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).