The fact remains though that Python is an excellent general purpose language, easy to learn, almost universally known, has libraries for everything (and that’s just the stdlib). It is well suited to rapid prototyping, scripting, and data wrangling. Adding incremental typing makes it even better.
* worse performance
* lack of immutable vectors, alleviated via style conventions
* rarely, awkward lambdas
vs.
* wide pool of people familiar with the language
* lack of JVM lockin: Scala native is not there yet, the library ecosystem is all JVM.
* [good] batteries included
* much better reflection
* access to modern ML
* gradual typing
* no actors
Rust: Manual memory management is verbose and distracting.
Go: Manual exception handling is verbose and distracting.
Kotlin: JVM lock-in.
Swift: Apple lock-in.
Lambdas in Python are quite limited, but offset by natural nested local functions.
Regarding performance, that's not always an issue, and depending on the use case can be addressed with async/await or using a multiprocessing pool. I have had issues with multiprocessing and some DB libs ib the past, but recently have had pretty good success.
Multithreading is still an issue because of the GIL (global interpreter lock) and really only useful if you're calling into a C/C++ lib that releases the lock while it does it's native things.
I've written a lot of Python in the last 15 years, and Ive written a ton of scripts that are faster than a well written identical C/C++/C# app, and was written in 1/10th of the time. It just depends on the use case.
Note that mypy/typed python fixes this: if you annotate a function as returning (or accepting) a Sequence/Collection/Iterable instead of a List, and attempt to mutate it, you'll get type errors. This is good practice anyway.
Swift runs on Linux and has done since it was made open source in 2015, a year after its initial announcement. Windows support is being worked on but, for the time being, it runs fine in WSL. No lock in.
I expect we may see some third-party, cross-platform reimplementations of SwiftUI very soon once the appropriate language features are set in stone and ship with the next version of Swift.
Otherwise, it's fairly healthy — lots of computational libraries, database, web, etc. Plus, Swift pretty much has direct compatibility with C and Python libraries without needing to wrap anything.
Could you please elaborate on this point?
Swift recently gained the features needed to call Python code. You can either use the Python module from Swift for Tensorflow or the PythonKit library, both of which allow calling Python code from within Swift.
The features used to allow calling Python from Swift can also be used for other dynamic languages, so there may be the ability to call Ruby and other languages' libraries in future as well.
>Kotlin: JVM lock-in
You know OpenJDK has been available for over a decade, right?
Mypy is a few years older than TypeScript, so, no.
The thing is, static typing is never the job by itself.
- script of 2,000 LOC to clean data => dynamic typing is fine => Python
- web service of 1,000,000 LOC => static typing seems a better choice => Rust, Go, Kotlin, Scala, Swift, C#, Java…