Hi -

despite the fact that Rebol is not yet multi-threaded, I have an
interesting project that I'm fiddling with, and need some help with.

I've taken the webserver.r script off of rebol.com, and am modifying it so
that it can run Rebol scripts to generate web pages.  Essentially it
intercepts all requests for "pages" that end in .rsp (rebol server page),
and then tries to execute them and spit back the output to the browser...

Of course the ideal would be to end up with some sort of script engine
very similar to PHP, or ASP, where <% %> indicates a block of code - that
way you could end up with the following:

test.rsp
--------
<HTML>
<HEAD>
        <TITLE>Test Rebol Server Page</TITLE>
</HEAD>
<BODY>
<% either request/argument/condition = true [ %>
        <font face="arial,helvetica">You are correct!</font>
<% ][ %>
        <font face="arial,helvetica">You are incorrect!</font>
<% ] %>
</BODY>
</HTML>

Ideally the script engine would have a "request" object - one of the
properties of the request would be the named arguments that had been
supplied when the page was requested - thus the URL for this page might
have read:

http://www.myserver.net/test.rsp?condition=true

Thus the actual HTML that would be sent back to the browser - after being
parsed by a rebol enabled server would read:

<HTML>
<HEAD>
        <TITLE>Test Rebol Server Page</TITLE>
</HEAD>
<BODY>
        <font face="arial,helvetica">You are correct!</font>
</BODY>
</HTML>

Or - the rsp page could be entirely a Rebol script, overriding any sort of
HTTP headers, and spitting back binary data - perhaps to generate an image
on the fly.  Or - if the rebol script generates a page, perhaps the <HTML>
<HEAD> tags could be autogenerated such that they include meta tags, and
the <TITLE> block simply transcribes the Title: from the rebol header...

Of course, most of this seems to be well beyond the current capabilities
of Rebol (as it stands right now).  I think it'll be possible to get a
rebol based web server to execute .r files, and spit back the output of
those scripts - but w/o multi-threading, it's performance under any load
will be poor.

- Porter

Reply via email to