4 ms·
So we have CPython which has an ffi and a native implementation of the source interpreter. We have PyPy which is JIT for Python that emits assembly at runtime
by hairy_man674 10y ago
So we have CPython which has an ffi and a native implementation of the source interpreter.
We have PyPy which is JIT for Python that emits assembly at runtime though not as successful Cpython for its support.
The complexity class of this problem, without type annotations, namely completely transforming an arbitary Dynamic Python program to a static, partially inferred typed language (C++) is O(N): https://en.m.wikipedia.org/wiki/Hindley–Milner_type_system https://en.m.wikipedia.org/wiki/Hindley–Milner_type_system
The transformations are also not guaranteed to improve runtime performance and might even do the opposite or have side effects for precision and a program that is slower due to generalizations that an algorithm makes.
With type annotations... why, just why? Use C++ or C if you want types and performance gains thereof..nThe potential for bugs and failures is less than relying on an algorithm if you realise the fear and laziness of compiled languages is umfounded.