2 ms·
> "Python is inherently harder to optimize than JS since it has <very dynamic features>" Python is not a very dynamic language in the sense that you actually c
by dom0 9y ago
> "Python is inherently harder to optimize than JS since it has <very dynamic features>"
Python is not a very dynamic language in the sense that you actually can't change a lot of stuff (and a number of the things you can change just segfault CPython). I think JS is more dynamic, for example. Or Ruby.
- icebraining 9y agoThese are not my arguments, mind you; I don't know enough to make them. You've piqued my interest, though: can you give me an example of those things that you can't change or that break CPython?
- dom0 9y agoThings like the Carlo Verre hack (also a thing you can't change —any more— in Python: builtins), editing objects during their construction (via e.g. gc)... generally, the gc module allows other ways as well to crash your interpreter. >>> import gc >>> 'foo'.lower() >>> gc.get_referents(str.__dict__)[0]['lower'] = str.upper >>> 'foo'.lower() segmentation fault (core dumped) python (That's the method lookup cache) A talk in this direction is https://www.youtube.com/watch?v=qCGofLIzX6g https://www.youtube.com/watch?v=qCGofLIzX6g