News for hackers. Stuff that matters.
Re:I don't understand Python's Asyncio by rumcajz on Sunday October 30, 2016 @12:54PM (#12830787)
Why can't Python have something like http://libmill.org ?

If it's doable in C, why not in Python?

Re:I don't understand Python's Asyncio by rdtsc on Sunday October 30, 2016 @02:12PM (#12831271)
It has those. It as the greenlet library and used by eventlet and gevent. Many use those, and they've been there for many years. But Guido and others decided that is not acceptable. So we've gone the Twisted route (because everyone know Twisted is easy and fun) and now we have yields, co-routines, futures, awaits and all the other mess.
Re:I don't understand Python's Asyncio by WaxProlix on Sunday October 30, 2016 @10:07PM (#12833817)
Lots of conversation between Armin and a few others about these approaches in reddit's /r/python thread for this article. I happen to think that gevent got a ton right, and the consensus seems to be that this 'new' approach is sort of half-baked, at least vis-a-vis python implementation.

https://www.reddit.com/r/Python/comments/5a6gmv/i_dont_under...

Re:I don't understand Python's Asyncio by sadgit on Monday October 31, 2016 @12:15AM (#12834260)
Totally agree. Its a damn shame, too, it fit so elegantly into a programming style that looked very analgous to the threading library. Look at Tornado's StackContext to see the kind of mess that callpack passing creates. Its a gc nightmare.
Re:I don't understand Python's Asyncio by afrancis on Sunday October 30, 2016 @10:33PM (#12833922)
Although I am not aware of any recent development, you should look at Stackless Python which was inspired by Limbo. Stackless Python has lightweight threads (stacklets) and synchronous channels a la various Bell labs family of languages (include Go). The greenlets that Gevent uses comes from Stackless.
Re:I don't understand Python's Asyncio by webmaven on Monday October 31, 2016 @12:39AM (#12834348)
How does Stackless CPython[1] compare with Stackless PyPy[2]?

[1] http://www.stackless.com/

[2] http://doc.pypy.org/en/latest/stackless.html

Re:I don't understand Python's Asyncio by afrancis on Monday October 31, 2016 @01:46PM (#12839121)
Although I have used both CPython and Stackless.py, the specific differences are fading from my memory. While working on a Go style select() for stackless.py I recall there were minor differences in how the runnable list is represented and accessed. However this is really an implementation detail. For the most part, they are pretty much the same.

The biggest difference I remember in the current stackless.py implementation, the move to "continuelets" resulted in the inability to pickle "complex" stackless tasklets. So it becomes more difficult to stop a tasklet in one thread and restart it in another. Maybe the ability to control the recursion depth (including getting rid of it) may also be gone in stackless.py.

Re:I don't understand Python's Asyncio by mzs on Sunday October 30, 2016 @02:16PM (#12831299)
http://libmill.org/documentation.html

  Libmill runs in following environments:

  Microarchitecture: x86_64, ARM
  Compiler: gcc, clang
  Operating system: Linux, OSX, FreeBSD, OpenBSD, NetBSD, DragonFlyBSD

  Whether it works in different environments is not known - please, do report any successes or failures to the project mailing list.
Re:I don't understand Python's Asyncio by danappelxx on Sunday October 30, 2016 @10:24PM (#12833888)
He was not suggesting to adopt libmill, only to adopt a similar concurrency scheme.
Re:I don't understand Python's Asyncio by mzs on Wednesday November 02, 2016 @01:00PM (#12856900)
I wasn't saying that either, I was saying libmill did not do it in (pure) C:

https://github.com/sustrik/libmill/blob/master/libmill.h

It only works with gcc and clang now, no longer with windows, and is sprinkled with asm()s. That doesn't fly with the CPython is portable. I don't know how these go-like features could be created with ANSI C, but I'd love to be proven wrong.

Re:I don't understand Python's Asyncio by gigatexal on Sunday October 30, 2016 @01:56PM (#12831154)
Whoa thanks for this, definitely going to check it out.