Making the move...

Dan Shafer revolutionary.dan at
Wed Mar 15 20:05:16 EST 2006

With the caveat that I am hardly a Rails expert and certainly have not done
a lot of work with Rev on the server side either, let me see if I can
clarify my earlier point here. I know that what I'm going to say is probably
so trivial to many reading this thread that it will seem like I'm just off
base, but I'm trying to make the issue I see really starkly clear.

With PHP or Ruby on Rails, a Web *app* consists of a collection of 1 or more
templates -- HTML files with embedded command and function calls -- that
execute in a server-side scripting language interpreter running on the
server. All Web pages with this embedded script code are run through the
scripting language interpreter on the server, where the command is carried
out and some content is generated to replace the command call before the
page is sent to the HTTP server to return to the client.

So for example (and I realize this is so simplistic that it may not be
sufficiently illustrative), in a .rhtml (rubified HTML) file, you might find
this construct:

It is now <%= %>

When this page is called from the client's browser, the Ruby method "now" is
called against the class Time (this is a class method), which returns a
string that replaces everything between the angle brackets in the Web page.
Every time that page is loaded, the method executes and the page is updated.
This is a direct call to the language interpreter, not a CGI execution (at
least that's how I understand this being handled). It is therefore blazingly
fast. We're not calling a script on the server and invoking a command or

Now if I understand things on the Rev side correctly -- and there are a lot
of folks here who know more about this than I do -- the only way to get a
Rev script to run is as a CGI. That means, among other things, that you'd
have to minimally create a text file with a script called "on startup" and
save that script as an executable CGI script. So you'd end up dealing with a
text file, permissions, and an indirect call to the contents of the script
file to accomplish the same thing that one line of embedded Ruby code does
in RoR. Furthermore, the execution of that CGI script would require an event
to be sent via a form button or a JavaScript onLoad() command; it's not just

I am NOT suggesting it would be impossible to remedy these issues in Rev.
Nor am I suggesting that the overhead of this processing is so onerous that
using Rev CGI solutions is impractical. All I'm trying to say is that there
is a pretty fundamental difference here between invoking a script language's
command directly and being forced to explicitly call a CGI function that in
turn executs a script command.

Now before you jump in my face again, go back and re-read the caveat at the
beginning of this message. :-)
Dan Shafer, Information Product Consultant and Author
Get my book, "Revolution: Software at the Speed of Thought"

More information about the Use-livecode mailing list