Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68234

Re: which async framework?

From Antoine Pitrou <solipsis@pitrou.net>
Subject Re: which async framework?
Date 2014-03-11 18:43 +0000
References <531E22DF.7030709@simplistix.co.uk> <1733040935416225908.878896sturla.molden-gmail.com@news.gmane.org> <loom.20140311T170030-477@post.gmane.org> <372076480416251284.821607sturla.molden-gmail.com@news.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.8056.1394563452.18130.python-list@python.org> (permalink)

Show all headers | View raw


Sturla Molden <sturla.molden <at> gmail.com> writes:
> 
> Antoine Pitrou <solipsis <at> pitrou.net> wrote:
> 
> > Yes, why use a library when you can rewrite it all yourself?
> 
> This assumes something equivalent to the library will have to be written.
> But if it can be replaced with something very minimalistic it is just
> bloat. I would also like to respond that the select module and pywin32 are
> libraries.

Lower-level ones, though. Just like C malloc() is lower-level than
Python's memory management.

This is the usual assumption that high-level libraries are made of useless
cruft piled up by careless programmers. But there are actual reasons 
why these frameworks have a significant amount of code, and people who 
decide to ignore those reasons are simply bound to reimplement 
non-trivial parts of those frameworks in less careful and less tested
ways (and they have to maintain it themselves afterwards).

What irks me with your response is that you phrased it as though writing
a good event loop was an almost trivial thing to do, which it is not
once you start considering multiple use cases and constraints. It is
quite irresponsible to suggest people don't need the power of network
programming frameworks. I would personally distrust a programmer who
chooses to reimplement their own event loop, except if they happen to
have a very brilliant track record.

> Another thing is that co-routines and "yield from" statements just
> makes it hard to follow the logic of the program. 

That's an optional part of Tornado and asyncio, though. It is very
reasonable to use Tornado or asyncio and still code in purely
callback-driven style (even though Guido himself prefers the coroutine
style).

Regards

Antoine.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: which async framework? Antoine Pitrou <solipsis@pitrou.net> - 2014-03-11 18:43 +0000
  Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 00:28 +0200
    Re: which async framework? Chris Angelico <rosuav@gmail.com> - 2014-03-12 09:38 +1100
      Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 01:18 +0200
        Re: which async framework? Chris Angelico <rosuav@gmail.com> - 2014-03-12 10:38 +1100
          Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 02:10 +0200
        Re: which async framework? Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-12 03:58 -0600

csiph-web