A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.exaloop.io/codon/general/differences below:

Differences with Python | Codon: high-performance Python compiler

Differences with Python | Codon: high-performance Python compiler
  1. General
Differences with Python

While Codon's syntax and semantics are nearly identical to Python's, there are some notable differences that are worth mentioning. Most of these design decisions were made with the trade-off between performance and Python compatibility in mind.

Please see our roadmap for more information about how we plan to close some of these gaps in the future.

Since Codon performs static type checking ahead of time, a few of Python's dynamic features are disallowed. For example, monkey patching classes at runtime (although Codon supports a form of this at compile time) or adding objects of different types to a collection.

These few restrictions are ultimately what allow Codon to compile to native code without any runtime performance overhead. Future versions of Codon will lift some of these restrictions by the introduction of e.g. implicit union types.

For performance reasons, some numeric operations use C semantics rather than Python semantics. This includes, for example, raising an exception when dividing by zero, or other checks done by math functions. Strict adherence to Python semantics can be achieved by using the -numerics=py flag of the Codon compiler. Note that this does not change ints from 64-bit.

While most of the commonly used builtin modules have Codon-native implementations, a few are not yet implemented. However these can still be used within Codon via from python import.

Many other missing features are also described in [Roadmap].


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4