3 ms·
In other words, not everyone involved is consenting to the things they're doing at runtime.
by SerLava 9y ago
In other words, not everyone involved is consenting to the things they're doing at runtime.
- progval 9y agoit's also a pain for compilers
- stochastic_monk 9y agoIf Python is interpreted, what’s the pain? Do you mean static compilers like Cython/pybind11/Boost.Python, or JIT compilers?
- gt_ 9y agoWhat does this mean?
- progval 9y agoIt's hard to make optimizations, because you cannot make a lot of assumptions ahead of time on how the code is going to run. For instance, one can override most of the builtin functions like len().
- gt_ 9y agoI am curious how this effects the compiler in particular?Does the compiler measure this in some way and respond with different behavior? Or is it already designed less efficient to account for these types of operations? Or a mixture of both and/or more nuanced hurdles? Thanks for any info you can provide.
- progval 9y agoPython 3.6 added a version field to dictionnaries. As all variables are looked up in dictionnaries (aka namespaces), a compiler can replace a call to a builtin by a test of the version of the builtins dict (aka a guarde), which chooses between an optimized version and the "naive" code. Further reading: https://www.python.org/dev/peps/pep-0509/ https://www.python.org/dev/peps/pep-0509/