threading
Rustom Mody
rustompmody at gmail.com
Thu Apr 10 14:14:36 EDT 2014
On Thursday, April 10, 2014 10:38:49 PM UTC+5:30, Chris Angelico wrote:
> On Fri, Apr 11, 2014 at 2:25 AM, Marko Rauhamaa wrote:
> >> I don't know Python's asyncio as it's very new and I haven't yet found
> >> an excuse to use it, but with Pike, I just engage backend mode, set
> >> callbacks on the appropriate socket/file/port objects, and let things
> >> happen perfectly.
> >
> > That "set callbacks" and "let things happen" is the hard part. The
> > framework part is trivial.
>
> Maybe. Here's a simple self-contained Pike program that makes a simple
> echo server - whatever comes in goes out again:
>
For analogy let me take a 'thought-discussion' between a C programmer and a python programmer regarding data structures.
-----------------------------------------------------
PP: Is it not tedious and error prone, C's use of data structures? How/Why do
you stick to that?
CP: Oh! Is it? And what do you propose I use?
PP: Why python of course! Or any modern language with first class data and
garbage collection! Why spend a lifetime tracking malloc errors?!
CP: Oh! is it? And what is python implemented in?
PP: But thats the whole point! Once Guido-n-gang have done their thing we are
unscathed by the bugs that prick and poke and torment you day in day out.
CP: Lets look at this in more detail shall we?
PP: Very well
CP: You give me any python data structure (so-called) and I'll give it to you
in C. And note: Its very easy. I just open up the python implementation (its in
C in case you forgot) and clean up all the mess that has been added for the
support of lazy python programmers. In addition, I'll give you a couple of more
data-structures/algorithms that we have easy access to but for you, your only
choice is to drop into C to use (HeHe!)
PP: You are setting the rules of the game... and winning. I did not say I want
fancy algorithms and data structures. I said I want (primarily) the safety of
garbage collection. Its also neat to have an explicit syntax for basic data
types like lists rather than scrummaging around with struct and malloc and
pointers (hoo boy!)
CP: Yeah.. Like I said you like to be mollycoddled; we like our power and freedom
-----------------------------------------------
If I may use somewhat heavy brush-strokes:
Marco (and evidently Chris) are in the CP camp whereas Sturla is in the PP camp.
Its just the 'data-structures (and algorithms)' is now replaced by 'concurrency'
Both these viewpoints assume that the status quo of current (mainstream)
language support for concurrency is a given and not negotiable. Erlang/Go etc disprove this.
More information about the Python-list
mailing list