From jeff.horner at Vanderbilt.Edu  Thu Aug 26 20:55:36 2004
From: jeff.horner at Vanderbilt.Edu (Horner, Jeff)
Date: Thu Aug 26 20:56:45 2004
Subject: [Rd] R as shared library
Message-ID: <BA5458EA4625894B8A7B70CB1307CA90081BC5@mailbe07.mc.vanderbilt.edu>


>From: A.J. Rossini [mailto:rossini@blindglobe.net]
>
>Jeffrey Horner <jeff.horner@vanderbilt.edu> writes:
>
>> Good point. However, I chose this route to 1) understand R and its
>> internals, which is more complicated than I thought,  2) write an
>> apache module, which I've always wanted to do, and 3) leverage
>> Apache's robust server technology. In my opinion, no other server
>> software is as scalable and reliable as Apache. Plus, it has a module
>> API to plugin other code, like an R interpreter.
>
>All good reasons.  But what is the final API going to look like?  Are
>you planning on SSI's for the general interface?

For my prototype which already works, it's as simple as placing your code
in a .R file accessible from the web server. That means your R code is
responsible for generating HTML, similar to other languages embedded
into Apache like Perl and Python. PHP is different in that the interpreter
is only entered once a special tag is seen:

file.php
-------------
<html>
<body>
<?php  
 /* php code here */ 
?>
</body>
</html>
-------------

And you can jump into and out of the interpreter an unlimited number of times.
This allows for embedding parts of the HTML document within your code. Whether
or not this is a good thing is debatable.

The problem I'm working on right now, and which was talked about in the
previous emails, is how to expose the CGI data to the R interpreter. Another
part of this is how tight should R hook into Apache. Languages like Perl and
Python expose many different parts of the http request to be overidden by
language specific handlers, whereas PHP doesn't.

My intent is to release a proof of concept prototype and then work with the R
developer community to determine how it should evolve.

Jeff

	[[alternative HTML version deleted]]


[Rd] R as shared library
Horner, Jeff