3 ms·
Python is not very difficult to implement [1], the hard part is making it fast. That's because every property access involves a lot of magic behind the scenes,
by yorwba 8y ago
Python is not very difficult to implement [1], the hard part is making it fast. That's because every property access involves a lot of magic behind the scenes, like __getattribute__, __getattr__ and the method resolution order. And because Python is dynamically typed, that dispatch logic can't be compiled away but needs to execute every time. (PyPy's JIT can probably speed it up, but still needs deoptimization checks in case types change.)
[1] see https://github.com/nedbat/byterun https://github.com/nedbat/byterun for a Python implementation