Python & Go

Michele Simionato michele.simionato at gmail.com
Sun Nov 15 00:15:11 EST 2009


On Nov 15, 3:00 am, Terry Reedy <tjre... at udel.edu> wrote:
> It seems to me that generators are already 'channels' that connect the
> calling code to the __next__ method, a semi-coroutine based on the body
> of the generator function. At present, the next method waits until an
> object is requested. Then it goes into action, yields an object, and
> rests again.
>
> I see no reason why we cannot have that with Python. I not even sure we
> cannot have it with CPython, but I am not familiar enough with threads,
> processes, and CPython internals.

Of course we can have Go capabilities with Python. We already have
generators and the multiprocessing module. It is just a matter of
performance: I assume the Go implementation is more efficient. It
would be nice to have numbers to quantify this claim. One can still
write prototypes in Python and convert them in Go and the process
looks less cumbersome than converting them in C or C++. I could never
force myself to write C or C++; but I do not have any particular
resistence to coding in Go, should I need a performance-oriented
language.



More information about the Python-list mailing list