5 ms·
> The two main drawbacks of Python from my point of view are (1) there is very little compile-time error analysis and type declaration, even less than Lisp, and
by aldanor 6y ago
> The two main drawbacks of Python from my point of view are (1) there is very little compile-time error analysis and type declaration, even less than Lisp, and (2) execution time is much slower than Lisp, often by a factor of 10 (sometimes by 100 and sometimes by 1).
Both have been improved on - in particular (1), with `typing` module, type annotations, mypy and so on. With (2), Python's speed has increased somewhat since, but then again, you won't be doing large-scale math without numpy, and for non-vectorizeable numeric computations you'd probably use something like jit-compiled numba or the like.
- zitterbewegung 6y agoThe big thing that has allowed Python to flourish is the fact that it has a good foreign function interface and was easy to use to the point that both academics and web developers would learn it. It really got a second wind as ML got more and more popular. Not many languages can be used to create an ML application end to end (but building on the shoulders of Google and or other large big tech / ad tech companies).
- Blikkentrekker 6y agoEveryone claims to be able to explain in hindsight why something became popular. I believe that the overwhelming factor of why something does or does not become popular is simply chaotic luck. In an alternate history where Python was designed exactly the same, but a butterfly at Guido's desk flapped his wings slightly differently, Python would have been obscure.
- cutler 6y agoAgreed. Well put.
- mumblemumble 6y ago> I believe that the overwhelming factor of why something does or does not become popular is simply chaotic luck. This seems to me a bit like saying, "That color isn't cerulean, it's blue." Describing the specific instances of serendipity that have led to Python's continuing success doesn't imply that it wasn't dumb luck. It's just a way of saying, "Here's an interesting bit of dumb luck."
- bachmeier 6y agoThis is technically correct, but it's also true that if a group of dedicated Python enthusiasts (led by Travis Oliphant) hadn't created a Python ecosystem before they had users, we can say with certainty that Python would not have taken off in the numerical computing space. In 2005, when I was looking for a new language, I really wanted to use Python but it was simply not an option.
- omilu 6y agoMy theory is python is a cool sounding name for a programming language which contributed greatly to its success.
- jxy 6y agoPython had their smearing campaign claiming TIOOWTDI against Perl's TIMTOWTDI, and dubious claim's of sigils (`@$`) hurt readability. But once Python had the ecosystem going, it brought back `@`, `{}`, numerous `_`, fanciful `:=`. And, of course, there always is more than one way to do it in Python. Python's "easy to use" is just a lie, https://github.com/satwikkansal/wtfpython https://github.com/satwikkansal/wtfpython The common lisp CFFI module is nothing short of Python's. But, I know, people hate to put their `(` in front of their function names, and people hate to omit `,` between there function arguments.
- neolog 6y ago"Python is easy to use" is a relative statement about its priorities. Compare to other languages that have different priorities. Python is easier and slower than C++, for example. There are many design errors in Python, of course. But most "wtfpython" things don't actually affect people using the language -- they're engineered to identify funny compiler optimizations and floating-point peculiarities. The real problems of a language aren't usually the kind of thing demonstrated in a couple-line snippet. Though there are exceptions.
- jolux 6y ago>Python is easier and slower than C++, for example. Most languages are easier than C++, and many of them are faster than Python.
- neolog 6y agoThere are many dimensions that different languages prioritize. As you increase the number of dimensions you consider important, the number of languages that are better than $language on all of your important dimensions tends to decrease.
- jolux 6y agoSure. I have a lot of problems with Python’s design and find it grating, and I don’t think its biggest problems are about tradeoffs, they’re just mistakes.
- samatman 6y agoI'm not fond of the habit of glossing over the slowness of the Python interpreter by pointing out that you can use it as an FFI to fast code. That's great if you're using Python for numerics, and color within the lines. But: a general purpose programming language is used for general purposes. Even for numerics, composability suffers if the language itself is slow, since crossing between FFI packages must be done very carefully to prevent paying the cost of the interpreter. The fact is that Common Lisp, Julia, Swift, and LuaJIT (just to name a few), are substantially faster than Python, and it's not hard to come up with situations where this will matter. Worse, you might stumble into such a situation after committing to Python. Python has much to recommend it. But its slowness has been mitigated, not addressed, in the years since Norvig wrote this article.
- Blikkentrekker 6y agoThe startup time of the Python interpreter in particular disqualifies it for many tasks one would otherwise use it for. It disqualifies it for instance for window management scripts for which it's latency is too high.
- neolog 6y agoI use a python window manager, it's great. http://docs.qtile.org/en/latest/ http://docs.qtile.org/en/latest/
- Blikkentrekker 6y agoIf the actual window manager be written in Python, one obviously does not face the startup issue. If one attempt to send E.W.M.H. to the window manager using Python scripts, then one is faced with that.
- gjvc 6y agoE.W.M.H. == https://en.wikipedia.org/wiki/Extended_Window_Manager_Hints https://en.wikipedia.org/wiki/Extended_Window_Manager_Hints