3 ms·
In Python, you can get at a variable, or even code, in another thread with "getattr()". You can monkey-patch another thread while it is running. This is not ve
by Animats 10y ago
In Python, you can get at a variable, or even code, in another thread with "getattr()". You can monkey-patch another thread while it is running. This is not very useful, but it's easy to implement in a naive interpreter such as CPython. Part of the price for this is the Global Interpreter Lock, so you don't really have two threads running at once. PyPy has a huge amount of machinery so that stuff will work.
Grumpy doesn't even seem to try to implement that. That's a good thing. If you restrict Python a little, it's much easier to compile.
- mdaniel 10y ago> That's a good thing. If you restrict Python a little, it's much easier to compile. Isn't that more or less what RPython does? https://rpython.readthedocs.io/en/latest/architecture.html https://rpython.readthedocs.io/en/latest/architecture.html I mean, I know that starting with a full-fledged(?) Py27 codebase rules out _actually_ using RPython for the stated goals of Grumpy, but I think the two projects agree in principle and differ about the definition of "restricted" :-)
- masklinn 10y agoRPython is a restricted (hence R) language specifically for VM development, it is not a general-purpose language.