|
|
|
|
|
by xapata
3431 days ago
|
|
Python has made some trade-offs that you dislike. You complain about the negative consequences without comparing those against the benefits. One of the major factors in speed is efficient memory layout. Contrast a Python list with a NumPy array. To achieve speedier loops and vectorized arithmetic [0], the array gives up dynamic typing and dynamic sizing. In most applications, I would gladly give up some compute speed to gain some programming productivity. I love duck-typing. Formal typing has some impressive examples, but in the projects I've worked on has reduced my productivity. Perhaps because data are so often serialized to simple formats or written to databases that discard the best tools of formal typing. Anecdotal evidence, for sure. I've never been bothered by the GIL, but I have benefitted from it [1]. [0] https://docs.continuum.io/mkl-optimizations/ [1] https://www.youtube.com/watch?v=P3AyI_u66Bw |
|
Except numpy arrays have a much richer interface and can still store dynamic objects (dtype=object). So what's your point?
>I love duck-typing
So do I. Where does this come from? I don't believe I ever considered it a contra.