All Projects → cython → Cython

cython / Cython

Licence: other
The most widely used Python to C compiler

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
cython
566 projects
C++
36643 projects - #6 most used programming language
emacs lisp
2029 projects
shell
77523 projects

Projects that are alternatives of or similar to Cython

Data Science Career
Career Resources for Data Science, Machine Learning, Big Data and Business Analytics Career Repository
Stars: ✭ 630 (-90.44%)
Mutual labels:  big-data
Web Performance
Web性能的方方面面🚀
Stars: ✭ 675 (-89.75%)
Mutual labels:  performance
Sciblog support
Support content for my blog
Stars: ✭ 694 (-89.47%)
Mutual labels:  big-data
Appletrace
🍎Objective C Method Tracing Call Chart
Stars: ✭ 641 (-90.27%)
Mutual labels:  performance
Atreugo
High performance and extensible micro web framework. Zero memory allocations in hot paths.
Stars: ✭ 661 (-89.97%)
Mutual labels:  performance
Vibora
Fast, asynchronous and elegant Python web framework.
Stars: ✭ 5,734 (-12.96%)
Mutual labels:  performance
Moize
The consistently-fast, complete memoization solution for JS
Stars: ✭ 628 (-90.47%)
Mutual labels:  performance
Encoding
Go package containing implementations of efficient encoding, decoding, and validation APIs.
Stars: ✭ 705 (-89.3%)
Mutual labels:  performance
Flatlist Performance Tips
📱 Tips and tricks to improve your React Native FlatList performance and memory consumption
Stars: ✭ 666 (-89.89%)
Mutual labels:  performance
Vertx Sql Client
High performance reactive SQL Client written in Java
Stars: ✭ 690 (-89.53%)
Mutual labels:  performance
Solid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Stars: ✭ 13,115 (+99.07%)
Mutual labels:  performance
Why Did You Render
why-did-you-render by Welldone Software monkey patches React to notify you about potentially avoidable re-renders. (Works with React Native as well.)
Stars: ✭ 7,695 (+16.8%)
Mutual labels:  performance
Frameworkbenchmarks
Source for the TechEmpower Framework Benchmarks project
Stars: ✭ 6,157 (-6.54%)
Mutual labels:  performance
Fastexpressioncompiler
Fast ExpressionTree compiler to delegate
Stars: ✭ 631 (-90.42%)
Mutual labels:  performance
Bedrockframework
High performance, low level networking APIs for building custom servers and clients.
Stars: ✭ 697 (-89.42%)
Mutual labels:  performance
Web Frameworks
Which is the fastest web framework?
Stars: ✭ 6,125 (-7.03%)
Mutual labels:  performance
Samza
Mirror of Apache Samza
Stars: ✭ 676 (-89.74%)
Mutual labels:  big-data
Bundlephobia
🏋️ Find out the cost of adding a new frontend dependency to your project
Stars: ✭ 6,640 (+0.79%)
Mutual labels:  performance
Piscina
A fast, efficient Node.js Worker Thread Pool implementation
Stars: ✭ 696 (-89.44%)
Mutual labels:  performance
Meriyah
A 100% compliant, self-hosted javascript parser - https://meriyah.github.io/meriyah
Stars: ✭ 690 (-89.53%)
Mutual labels:  performance

Welcome to Cython!

Cython is a language that makes writing C extensions for Python as easy as Python itself. Cython is based on Pyrex, but supports more cutting edge functionality and optimizations.

The Cython language is very close to the Python language, but Cython additionally supports calling C functions and declaring C types on variables and class attributes. This allows the compiler to 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.

You can support the Cython project via Github Sponsors or Tidelift.

Installation:

If you already have a C compiler, just run following command:

pip install Cython

otherwise, see the installation page.

License:

The original Pyrex program was licensed "free of restrictions" (see below). Cython itself is licensed under the permissive Apache License.

See LICENSE.txt.

Contributing:

Want to contribute to the Cython project? Here is some help to get you started.

We are currently building the next great Cython edition: Cython 3.0. You can help us make the life of Python 3.x users easier.

Differences to other Python compilers

Started as a project in the early 2000s, Cython has outlived most other attempts at producing static compilers for the Python language.

Similar projects that have a relevance today include:

  • PyPy, a Python implementation with a JIT compiler.
    • Pros: JIT compilation with runtime optimisations, fully language compliant, good integration with external C/C++ code
    • Cons: non-CPython runtime, relatively large resource usage of the runtime, limited compatibility with CPython extensions, non-obvious performance results
  • 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.
    • Pros: JIT compilation with runtime optimisations
    • Cons: limited language support, relatively large runtime dependency (LLVM), non-obvious performance results
  • Pythran, a static Python-to-C++ extension compiler for a subset of the language, mostly targeted at numerical computation. Pythran can be (and is probably best) used as an additional backend for NumPy code in Cython.
  • 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.
    • Pros: good support for language and PEP-484 typing, good type inference, reasonable performance gains
    • Cons: no support for low-level optimisations and typing, opinionated Python type interpretation, reduced Python compatibility and introspection after compilation
  • Nuitka, a static Python-to-C extension compiler.
    • Pros: highly language compliant, reasonable performance gains, support for static application linking (similar to cython_freeze)
    • Cons: no support for low-level optimisations and typing

In comparison to the above, Cython provides

  • fast, efficient and highly compliant support for almost all Python language features, including dynamic features and introspection
  • full runtime compatibility with all still-in-use and future versions of CPython
  • "generate once, compile everywhere" C code generation that allows for reproducible performance results and testing
  • C compile time adaptation to the target platform and Python version
  • support for other C-API implementations, including PyPy and Pyston
  • seamless integration with C/C++ code
  • broad support for manual optimisation and tuning down to the C level
  • a large user base with thousands of libraries, packages and tools
  • almost two decades of bug fixing and static code optimisations

Get the full source history:

Note that Cython used to ship the full version control repository in its source distribution, but no longer does so due to space constraints. To get the full source history from a downloaded source archive, make sure you have git installed, then step into the base directory of the Cython source distribution and type:

make repo

The following is from Pyrex:

This is a development version of Pyrex, a language for writing Python extension modules.

For more info, take a look at:

  • Doc/About.html for a description of the language
  • INSTALL.txt for installation instructions
  • USAGE.txt for usage instructions
  • Demos for usage examples

Comments, suggestions, bug reports, etc. are most welcome!

Copyright stuff: Pyrex is free of restrictions. You may use, redistribute, modify and distribute modified versions.

The latest version of Pyrex can be found here.

Greg Ewing, Computer Science Dept
University of Canterbury
Christchurch, New Zealand
A citizen of NewZealandCorp, a wholly-owned subsidiary of USA Inc.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].