Aspect-oriented Python?

Richard van de Stadt stadt at cs.utwente.nl
Thu Jul 13 07:48:38 EDT 2000


Cees de Groot wrote:
> 
> I've been reading on aspect-oriented programming a bit, and it sounds really
> interesting. A Java implementation, AspectJ (www.aspectj.org) looks promising,
> but has the drawback that it only supports static weaving (wouldn't know
> how to do dynamic weaving with Java, so it's not a big surprise).

Composition Filters (See http://trese.cs.utwente.nl/sina/cfom/) is another
way to do Aspect Oriented Programming.

> With Python, experimenting with aspect-oriented stuff would probably be
> way easier, because it is easy enough to replace class methods etcetera. I've
> tried Google, but didn't find anything. Is someone busy with aspect-oriented
> programming for Python?

Over the years we've implemented Composition Filters in Smalltalk and C++ and
are currently working on an implementation in Java, which is quite hard, because
e.g. we want to know which object was the sender of a message, and we want to be
able to reason about messages (so we have to be able to make objects out of
messages, to e.g. pass them on, examine them, and then execute them).

This is not easy to do in Java (we're using inlining), but that's the language
we're targeting. From what I have seen from Python, I expect that it will be much
easier to do in Python.

The current Java version is described in a MSc thesis by Hans Wichman:
http://trese.cs.utwente.nl/cd3/publications/paperinfo/wichman.thesis.pi.top.htm

Richard.



More information about the Python-list mailing list