latest blog entry

Stackless Python

August 17th, 2006, By Duncan Gough

I do like Python.

PyGame. Twisted. wxPython. Stackless too.

I’ve tried to get started with Stackless many a time. I have plans. I have minor successes. I just fail to grasp something fundamental about it which leads to regular abandoment.

I know that EVE use Stackless. I know that the EVE developers ask the question, ‘Why isn’t everyone using Stackless?’ and it’s mostly to do with the documentation. I know nobody likes PHP anymore, me included, but their docs are first class. It’s just a simple www.php.net/$searchterm but it works. Maybe it works because the language is so simple. Maybe because the language is so bloated, good docs are needed.

Stackless, though, is making changes. A new website, a good tutorial. Since there’s now books on both Twisted and wxPython I’m hoping that a Stackless book isn’t far behing. In the meantime, though, EVE seems to have provided the key with which I can unlock the fundamental handle that I’ve been missing.

Stackless is just send and receive. It’s not multi-threaded, it’s not OS-threads, it’s thread of execution. There are tasklets and channels. Tasklets block unless you pay attention to them. So long as you do that, everything’s fine. Channels allow communication between tasklets. This leads co-operative multitasking, which they describe as being able to “program like you are single-threaded”. And then there’s the bullet point which made the penny drop:

‘Conceptually similar to Unix pipes’

Oh.

I see.

Download the Stackless Python in EVE presentation here.

« Previous PageNext Page »