[Twisted-Python] Twisted Presentation Materials...

alex clemesha clemesha at gmail.com
Wed May 7 18:07:05 MDT 2008

On Tue, May 6, 2008 at 5:56 PM, Glenn H Tarbox, PhD <glenn at tarbox.org> wrote:
> Scary thought...
>  I am giving a talk on Twisted at Sage Developer Days.  Its a fairly
>  broad audience WRT levels of Pythonism.. but with other talks having
>  titles like "Cylindrical Algebraic Decomposition", I doubt complexity in
>  and of itself is a concern.
>  This is a good opportunity to decompose Twisted into its core
>  elements... kinda how it would be presented to mathematics folks.  If I
>  don't screw it up, it might even be useful to a broader audience trying
>  to figure out what Twisted is and the kinds of problems it addresses.


I totally agree that talks that give a "What is Twisted?" type of
presentation are a good opportunity to decompose Twisted into its core elements.

Actually, the Sage project, and how it has been using Twisted,
is actually a really good case study of a project trying to get the most
out of what Twisted offers.

First, let me introduce myself, and tell you why I have a unique
view on the Sage project's use of Twisted.
My name is Alex Clemesha, and I have been involved with the
Sage project since its beginning.  I actually moved to Seattle from UCSD
for a while to work on it, with William Stein, a couple of years ago.

I also once did a small "What is Twisted?" talk at the
University of Washington to many Sage developers about
a year and a half ago, and this was before I really understood
the 'bigger picture' of Twisted, and how all its moving parts are related.

Now, here is how the Sage projects uses Twisted:
(You probably know this, but others might be interested):

a) The Sage notebook: (sagenb.org ,
b) DSage (Distrubuted Sage;
http://www.sagemath.org/doc/html/ref/module-sage.dsage.dsage.html )
c) In the future: math/computation web-service/API

DSage is a framework for parallel computation (similar to ipython1),
and uses Perspective Broker a great deal.  Yi Qiang is the developer,
and he also subscribes to this mailing list, so he might have more to
say about it.

The Sage notebook is something I know a lot more about.
In summary, the Sage notebook is a way to program in a notebook
like interface, in a web browser.  Each abitrary code block is sent to
the server to be executed, and the result is sent back, and displayed inline.
It utilizes twisted.web2 (including a twisted.web2 version of
written by me ... I have felt the impact of the twisted.web /
twisted.web2 debacel,
but that's a story for another time :)


Shifting gears slightly, I would like to tell you about a project that
me and some others have been working very hard on.
It is called Knoboo (pronounced 'nobu') (trac.knoboo.com / knoboo.com)
It's one that is really trying to get that most out of Twisted to
create a online computation notebook (with all the really pretty
front end, kind of like Mathematica + Google Docs + Google Notebook)
combined with remote backend computation 'kernels'.

>From an implementation standpoint, with Twisted, it looks like this:

* A main "App Server", that controls high level access with "twisted.cred"
* Web frontend:  "twisted.web2"
* Data:  some "twisted.enterprise.adbapi", moving to SQLAlchemy.
* "Kernels":  lightweight XMLRPC servers, local namespace is the
"computation enviroment"
* "Kernel Connections":  "twisted.pb" Perspective Broker
* "Kernel Managers":  start,stop, send signals with

Now I would like to pause for a minute and say:
"Damn!, look at the above list.  Twisted does a lot ... it's pretty incredible!"

Knoboo is now a "optional package" in Sage, and it
is still changing a lot, but I think it speaks of the general idea of what the
Sage dev group is aiming to get out of Twisted:
to utilize all the separate pieces as best as possible,
to create a single very useful tool.

Probably my main suggestion for Presentation materials
is to go to the Finger Tutorial:
and try to tweak it to really highlight the pieces that are in Twisted
that Sage can benefit from.

Some questions come to mind like:
"We have the Sage notebook, and we have DSage, and we want a
math web service API, how can we tie them together with Twisted?"

and more specifically:
with "twisted.cred" what will a "Notebook" avatar look like
compared to a "DSage" avatar, and how can we write their
different data access methods and other business logic,
so they can best work together?

So, good luck with your presentation!
I'm looking forward to seeing it and hopefully
learning more about Twisted as well.


>  I welcome all pointers / content / suggestions.
>  -glenn
>  _______________________________________________
>  Twisted-Python mailing list
>  Twisted-Python at twistedmatrix.com
>  http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list