[HN Gopher] Subinterpreters for Python
       ___________________________________________________________________
        
       Subinterpreters for Python
        
       Author : lukastyrychtr
       Score  : 23 points
       Date   : 2020-05-13 22:04 UTC (56 minutes ago)
        
 (HTM) web link (lwn.net)
 (TXT) w3m dump (lwn.net)
        
       | bsder wrote:
       | Oh how I wish Python had just sucked it up at 3.0 and eaten the
       | performance hit for removing the GIL.
       | 
       | By now, everybody would have optimized it back to normal (or
       | better!).
        
         | loeg wrote:
         | There was no possible way to do that given the things python
         | lets you get away with "atomically". Requiring explicit
         | synchronization to avoid data races would have been an even
         | bigger language break than the other breaking changes in 3.
         | Python is not a language for people who want to do fine-grained
         | explicit concurrency.
         | 
         | And doing it implicitly would require stupidly fine-grained
         | locks on all objects, destroying any performance gains; there's
         | no way to "optimize" that to GIL performance.
        
       | shanemhansen wrote:
       | I don't see the benefit of a subinterpreter compared to a
       | subprocess. I wish python didn't have a GIL, but I don't see what
       | problems this would solve for me that multiprocessing doesn't.
        
         | [deleted]
        
         | cheez wrote:
         | Yeah... super confusing.
        
         | joelthelion wrote:
         | Perfomance,I suppose? Spawning a process is expensive.
        
       | VWWHFSfQ wrote:
       | I feel like Lua would have gotten more traction in the early
       | days, and maybe eclipsed Python, if it wasn't so hyper-focused on
       | being a tiny embed-able language/runtime. It was so well-designed
       | from the very beginning.
       | 
       | Every new release of Python seems like it gets bigger and bigger
       | and more and more incomprehensible. The Python 2 -> 3 transition
       | was a (necessary?) disaster. And now we're trying, in earnest, to
       | figure out how to get rid of the GIL. The async/await syntax is a
       | whole other fiasco. Now we have colored functions all over the
       | place. Python code doesn't even work with Python code. It's just
       | an absolute mess.
        
       | coldtea wrote:
       | > _In particular, giving each subinterpreter its own global
       | interpreter lock (GIL) is not (yet) on the table._
       | 
       | What's the use then?
        
       | davidw wrote:
       | Tcl has had those for...20 years or so? They're pretty handy for
       | some things.
        
       ___________________________________________________________________
       (page generated 2020-05-13 23:00 UTC)