4 ms·
I proposed something like that for Python in 2010.[1] Immutable objects could be shared. Mutable objects had to either be unshared, or a subclass of an object t
by Animats 9y ago
I proposed something like that for Python in 2010.[1] Immutable objects could be shared. Mutable objects had to either be unshared, or a subclass of an object that enforced synchronization.
Python's Little Tin God didn't like it. Mostly because I proposed to freeze the code of the program once the second thread started. That takes away much of the dynamism he insists on.
Might be worth looking at again. The separation of data into immutable, unshared, or synchronized is mainstream now.
[1] http://animats.com/papers/languages/pythonconcurrency.html http://animats.com/papers/languages/pythonconcurrency.html
- kllrnohj 9y agoPython seems like an odd place to try and shove this into. Both due to its heavy object mutability & dynamic nature in combination with the GIL making heavy threading of python code a waste of everyone's time anyway. There aren't many languages with the concept of ownership or moving at all, and trying to retro-fit that is probably going to be not a good experience for anyone involved. Rust is largely there, in yet another thing it does well, but if you don't want that something like C++ would be probably a better place to try it. There you at least have move & ownership as a language concept already.
- Animats 9y agoWhen I wrote that, Rust didn't exist, C++ didn't use move semantics much, and Python was more important than it is now.