[Python-ideas] Python 3000 TIOBE -3%

Mark Shannon mark at hotpy.org
Fri Feb 10 10:29:55 CET 2012

There are a lot of things covered in this thread.
I want to address 2 of them.

1. Garbage Collection.

Python has garbage collection. There is no free() function in Python,
anyone who says that Python does not have GC is talking nonsense.
CPython using reference counting as its means of implementing GC.

Ref counting has different performance characteristics from tracing GC,
but it only makes sense to consider this is the context of overall
Python performance.
One key disadvantage of ref-counting is that does not play well with 
threads, which leads on to...

2. Global Interpreter Lock and Threads.

The GIL is so deeply embedded into CPython that I think it cannot be 
removed. There are too many subtle assumptions pervading both the VM and 
3rd party code, to make truly concurrent threads possible.

But are threads the way to go?
Javascript does not have threads. Lua does not have threads.
Erlang does not have threads; Erlang processes are implemented (in the 
BEAM engine) as coroutines.

One of the Lua authors said this about threads:
(I can't remember the quote so I will paraphrase)
"How can you program in a language where 'a = a + 1' is not deterministic?"

What Python needs are better libraries for concurrent programming based 
on processes and coroutines.


More information about the Python-ideas mailing list