Steven Parkes : smparkes.net

Archive for the ‘dramatis’ Category

Dramatis release

1:04 PM
Palo Alto
6 June
2008

The first alpha release of dramatis hit the streets today.

dramatis is a library available in Ruby and Python used to write concurrent programs based on the actor model of concurrency.

The release, labeled 0.1.1 (0.1 for first alpha, patch level 1 since the first release artifacts were a bit bollixed up), is available on rubyforge and pypi, as well as the git repository.

This release supports both Ruby and Python and comes with documentation, including API docs, several examples, and a tutorial.

The Python docs are, admittedly, a bit squirrely. The code has docstrings in it but the docstrings have not been pulled out into HTML. After looking at pydoc, epydoc, happydoc, and doxygen, it’s still not clear to me the best approach to Python API docs. I’d appreciate suggestions and recommendations.

It’s still early in dramatis’ life. It’s useful in its current state for writing data-driven/data-flow kinds of code and for concurrent I/O. It should be truly concurrent in JRuby but the last JRuby snapshot I tested (which was a while ago) had some weird dynamics when threads were involved. Need to test that again.

The two things I’d like to expand first are:

- Added actor-to-thread-pool binding so non-thread-safe code like GUI toolkits can be integrated

- Interprocess communication via XMPP

    but the list of things that would be fun (and useful) to implement is long …

    Comments are welcome here or on the the google group.

    It’s an interesting time for actor concurrency. I try to follow the related discussions on the Erlang and Scala mailing lists and the rubinius IRC channel. Not to mention the stuff that happens at large, things like Ezra’s talk about Vertebra. (Hmmm … other people have talked about actors; Ezra seems to use agent; I thought I saw him write actors, but I don’t see it now).

    Wonder if it’s time to have a place for language/library-agnostic actor discussions?

    Dramatis prerelease

    4:14 PM
    Palo Alto
    22 April
    2008

    A lot of interest has been growing in actors in the last year or two. This is almost certainly due in no small part to Joe’s book on Erlang. But I also think there’s a growing need for actors: I see more and more people running into limitations in serial programming, both on the web and off. I know I have.

    Last year, I started putting together a simple webapp to help me search and reserve books at the several local libraries I use (and Amazon). As coding progressed, things got slower and slower as more features required accessing these various web services, one after another through multiple steps. Many of them are none too fast individually; in aggregate, they crawl. Most of these services could be accessed concurrently if I could express concurrency in my app.

    Enter threads. I’ll admit it. I hate threads. Threads know nothing about my carefully crafted classes and instances: they run roughshod through them. I want my objects and concurrency, too.

    Which is pretty much the description of actors: they’re chimeras: part object, part thread. We’ve known about them for a long time: the actor model is thirty years old. But we’re trying to do more with our interconneted systems than we have in the past. At least I am. So now I care more than I did thirty years ago.

    Unfortunately, the languages I use the most, ruby and python, don’t have actors and while I respect (and am happy to copy the great ideas from) Erlang and OTP, it’s not really feasible for me to jump to a functional language. There are several actor libraries for python and ruby but their design targets, in terms of functionality and platform, are different than my needs.

    So today I put out a (pre)release of dramatis, an actor library for dynamic languages … which is, right off, a bit of a stretch. The current prerelease is Ruby only (though it does run on 1.8.6, 1.9. and jruby … and at least a little on Rubinius). But the python implementation has started and since it’s a fairly straightforward reimplementation of the Ruby version, should be available soon.

    dramatis shares a lot in common with other actor implementations. In fact, I tried to copy a lot of the best practices from other implementations, though there’s much more to be copied. It does have a few things that make it a bit unique. It’s pretty tightly integrated with the native language: writing programs with dramatis actors looks an awful lot like writing programs with normal objects. Hopefully this makes adding concurrency to programs easier, though I suppose only time will tell.

    It’s at prerelease in as much as it isn’t packaged (there’s no ruby gem yet) and it hasn’t been vetted by many. But it’s downloadable from the git repository and comes with docs, a tutorial, and a few examples. Tested on Linux and OS X.

    If you’re an adventurous type and brave enough to do some of that aforementioned vetting, have at …