.namespace [ 'MyHandler' ]
.local pmc r
find_type $I0, 'Apache::RequestRec'
r = new $I0
r.'puts'("Just a bunch of text.")
I was able to encapsulate Apache's request_rec structure in a Parrot object, and I've implemented a 'puts' method that calls ap_rputs using the request_rec and the supplied string.
You can use this as a content handler in httpd.conf:
Now, you can write entire handlers in Parrot, but the real goal is to have higher-level languages use Parrot to instantiate Apache::RequestRec objects and use them as they see fit for mod_perl, mod_python, or mod_whatever. mod_parrot will act as the layer between the language and Apache -- infrastructure we can write once instead of once for each language. A lofty goal, yes, but so is everything with Parrot.
Source code is coming soon.