And does it solve the infamous GIL (global interpreter lock) problem?
And does it solve the infamous GIL (global interpreter lock) problem?
They need some form of locking around Python objects accessed from multiple threads, since Python has no ownership model. Do they add a lock around each individual object?
Skip down to "thread safety"
"Ownership models" are not a given. C++ has no "ownership model" and it doesn't lock around objects. Multi-threading users are just given the synchronization primitives and are expected to manage their own solutions.
The same is true in Python: https://docs.python.org/3/library/threading.html#lock-object... - in fact, if you're using objects simultaneously from multiple threads without using some sort of locking scheme, you're probably already in trouble...
The main thing that's keeping the GIL around is the reference-counting garbage collector. If your python implementation uses its own GC mechanism, it doesn't have this problem.
The GIL isn't some halting problem level thing. As you allude to, Python could definitely decide to go multithreaded and add in the requisite locks. They haven't.
I really wish that the PSF would
* Make a spec
* Break out the stdlib into a portable library, and by portable, something that can be shared across PyPy, Graal, Jython, etc.
* ??? yes
What's hard is doing it without dumpstering single thread performance.
I’ve asked myself this question (in a different context) and have concluded that, in general, developers are incredibly resistant to learning and using new languages.
For example: if they weren’t, then server-side JavaScript would never have become popular.
You make it sound like a personal psychological failing.
In real life, using the same language has business benefits: re-use of the same libraries, no duplicated business logic that needs to be used on both client/server, no need for training to the new language, no need for mental context switch due to the language change when working on the client or server part (aside from the essential domain knowledge of client vs server), less/common tooling infrastructure, and so on...