Ruby Web Application Framework Roundup

paul vudmaska paul@vudmaska.com wrote in message news:401ECA9F.4070903@vudmaska.com…

Gavin Kistner wrote:

gabriele renzi wrote:

…

–
(-, /\ / / //

You’ve pretty well described Zope.org. When you’re done porting that to
ruby, please send me a link to the code :wink:

you also described our Ruby Web Application Server (version 2 is
codenamed ‘Root’) check out some examples (in greek, sorry):

www.joy.gr
www.pcmag.gr
www.glamourmag.gr
www.focusmag.gr

it uses xml based server pages, xsl/css for skins, fragment/object
caching, an object database system, plugable modules (cms, user pages,
forum), and runs with mod_ruby or mod_fastcgi. It also allows realtime
communication with flash clients using XmlSocket.

the latest version has rather clean source code, so maybe we can
release something pretty soon.

regards,
George Moschovitis

I’ve got too many things rattling around in my head lately to be sure. I
think it was a different list, though. That one I knew about. Thanks for
the reminder, though. I’m going to tweak the Iowa entry a bit.

Thanks,

Kirk Haines

···

On Tue, 25 May 2004 03:29:42 +0900, Dick Davies wrote

Do you mean this?

http://www.rubygarden.org/ruby?HtmlTemplates

No. This one is on web frameworks – which may or may not
include their own template system.

···

On Tuesday, 25 May 2004 at 3:29:42 +0900, Dick Davies wrote:

Do you mean this?

http://www.rubygarden.org/ruby?HtmlTemplates

–
Jim Freeze
Gray’s Law of Programming:
_n+1' trivial tasks are expected to be accomplished in the same time as _n’ tasks.

Logg’s Rebuttal to Gray’s Law:
_n+1' trivial tasks take twice as long as _n’ trivial tasks.

Iowa uses an LRU cache. Each page visited does trigger another usage
chunk. However, some smart cache management helps. How deep of a page
cache do you really need? How deep of a session cache do you need?

The application that generates the LARGE reports also drives a really
basic two page application for people to request prospectus information
and it drives some basic dynamic pages that display data from a database.
I have it confugured to keep 100 sessions in cache. For most uses,
that is overkill, and is another one of the reasons for the 50 meg
RSS. It’s useful right after an ad runs when things get really busy,
but that is about it.

I’ve been working some on caching behavior. Right now it’s basically
static – set when the application deamon is started. However, I’ve been
working on some tools to view the current active cache utilization,
including how long things are living in the cache before rolling out and
things of that nature to enable, initially, the ability to tweak the cache
settings behind the scenes. Eventually I’d like to at least experiment
with a cache that, within the guidance of some set of parameters, can self
adjust its cache size in order to dynamically respond to changing load
situations.

Kirk Haines

···

On Tue, 3 Feb 2004, Chris Morris wrote:

How does Iowa store each continuation stack (which is my own, uneducated
term – same thing as the resident set size?) ? From my unscientific
checking of Borges, it seemed each continuation got its own place in
memory, so virtually every page visit triggered another usage chunk, and
it seemed to grow very quickly with just one user. If Eric’s reading
this (Borges author), maybe he can chime in with some more specifics.

Chris Morris chrismo@clabs.org wrote in message news:401EAC45.3090604@clabs.org…

Kirk Haines wrote:

With Iowa,
on a Linux (RedHat) box, my resident set size for the app that is handling
the large dual mapped content mutual fund website is about 13.5 meg.

How does Iowa store each continuation stack (which is my own, uneducated
term – same thing as the resident set size?) ? From my unscientific
checking of Borges, it seemed each continuation got its own place in
memory, so virtually every page visit triggered another usage chunk, and
it seemed to grow very quickly with just one user. If Eric’s reading
this (Borges author), maybe he can chime in with some more specifics.

Iowa (at least back when I first wrote it :wink: doesn’t use
continuations, although it’s still resource intensive compared to many
alternatives, because it stores a bunch of state for each page view.
But as Kirk shows, it stays within acceptable limits.

Chad Fowler and I were looking into Borges resource usage earlier
today, and it seems to be out of control - Chad was seeing about an
extra 1MB (!) of resident size per page view.

I did some simple benchmarks and it does appear that Ruby uses an
awful lot of memory while capturing continuations (I calculate about
6k per stack frame), but this seems to be temporary and goes away
after a GC, even if you hang onto the continuation itself. GC doesn’t
seem to help much with Borges.

As an indication of what I would expect from a Borges-like framework,
the Squeak version of Seaside tends to use about 100-300k per
concurrent user. Not insignificant, but fairly manageable.

It’s always interesting to see what happens to one’s work. I wasn’t
involved at all in the development of Borges (beyond picking the name
:wink: - I wasn’t fully aware of the work Eric was doing until I saw his
RubyConf slides. Eric told me after he finished the port that there
were cases where he didn’t really understand what was going on, but
just copied verbatim what I had done in Smalltalk. It wouldn’t
surprise me if rewriting Borges from first principles in idiomatic
Ruby made some of these problems go away (though of course, my ideas
about what these “first principles” might be are always evolving…).
If this style of framework is interesting to people (and it seems to
be), I’d be willing to help some folks start fresh and “do it right”.

Cheers,
Avi

you also described our Ruby Web Application Server (version 2 is
codenamed ‘Root’) check out some examples (in greek, sorry):

finally !
I hoped someone could point that out, I already did this in he past :wink:

the latest version has rather clean source code, so maybe we can
release something pretty soon.

could you refine your concept of ‘pretty soon’?

plus, you say ‘release’ and I read ‘open source’ in you web site. I
wonder if you’re going to let this product under some kind of OSI
approved license or whatever.

It would be incredibly cool to have a company like Zope corporation
working on an open source app server.

PS
btw I just discovered http://www.rubycrafters.com/ and even that seem
really cool, I wish best luck to all the ruby hackers out there

···

il 3 Feb 2004 05:28:19 -0800, gm@navel.gr (George Moschovitis) ha scritto::

Nice! So these pages are running Root? I dont need to
know Greek to see there is a lot going on there - so I
hope so.

Did you say Root was based on J2EE? I moved away from
that because of its complexity - so I hope you left
that out :slight_smile:

The coolest thing about zope imo, is the web interface
for developers,users, and content editors,etc. Maybe
we’ll get to see that in Root? If you want to make it
approachable, from many angles, this would be a great
feature.

It would seem advantagous for all to collectively
consider/define/provide use cases for, what IS a web
application platform - and not necessarily how it is
implemented - a path to WAP driven by consensus. In my
mind zope is a long way towards that and we can learn
a lot from it. They just made the mistake of using
python rather than, well, you know :slight_smile: Anyway i really
like the start to this and rubycrafters.com.

Paul

···

— George Moschovitis gm@navel.gr wrote:

paul vudmaska paul@vudmaska.com wrote in message
news:401ECA9F.4070903@vudmaska.com…

Gavin Kistner wrote:

gabriele renzi wrote:

…

–
(-, /\ / / //

You’ve pretty well described Zope.org. When you’re
done porting that to
ruby, please send me a link to the code :wink:

you also described our Ruby Web Application Server
(version 2 is
codenamed ‘Root’) check out some examples (in greek,
sorry):

www.joy.gr
www.pcmag.gr
www.glamourmag.gr
www.focusmag.gr

it uses xml based server pages, xsl/css for skins,
fragment/object
caching, an object database system, plugable modules
(cms, user pages,
forum), and runs with mod_ruby or mod_fastcgi. It
also allows realtime
communication with flash clients using XmlSocket.

the latest version has rather clean source code, so
maybe we can
release something pretty soon.

regards,
George Moschovitis


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

could you refine your concept of ‘pretty soon’?

when we find time to write some simple docs, and a small example
webapp in english. We have set a target for the end of March.

plus, you say ‘release’ and I read ‘open source’ in you web site. I
wonder if you’re going to let this product under some kind of OSI
approved license or whatever.

We will release the source code for the server. Later we will probably
release the framework as well.

It would be incredibly cool to have a company like Zope corporation
working on an open source app server.

naaah, we are not that ambitious. But our product is really strong (though
I am saying it myself)

George Moschovitis
Navel Ltd.

My bad. Long day. Yeah, most of what is going on under the covers is
still your code. Not continuations. Rather, state is tracked via a trail
of objects, basically. When a new user first comes in, a session object
is created that corresponds only to the interaction between that user.
Each page/component that is created is an object, and the pages are stored
in cache. Backtrack, and you return to the context of an earlier object,
so long as you don’t backtrack out of what is in the cache. Choose a
different link/option/action at that point generally works just like you
had never done anything else, as Iowa takes care of remembering all of the
state. But no, not continuations. That’s a different bit of magic. Time
to go take a nap, now.

Kirk Haines

···

On Tue, 3 Feb 2004, Avi Bryant wrote:

Iowa (at least back when I first wrote it :wink: doesn’t use
continuations, although it’s still resource intensive compared to many
alternatives, because it stores a bunch of state for each page view.
But as Kirk shows, it stays within acceptable limits.

For my purposes, I have a really simple definition. A Web Application
Framework is a skeleton that takes care of all of the yucky bits about
creating dynamic content – whether it be a single page or a massive
application – so that I can concentrate on just handling the important
things.

And important things boils down to code that handles the actual
functionality of the page/app and a layout for what is being returned to
the user, prefereably seperated from the code so that the two can be
handled independently.

Kirk Haines

···

On Wed, 4 Feb 2004, paul vudmaska wrote:

It would seem advantagous for all to collectively
consider/define/provide use cases for, what IS a web
application platform - and not necessarily how it is
implemented - a path to WAP driven by consensus. In my

There is a version of Borges floating about with a broken LRUCache. It
will consume approximately 1MB per page view, and never let go (ouch!).

See:

http://216.254.21.90/cgi-bin/cvsweb.cgi/ruby/seaside2/Borges/lib/Borges/Utilities/LRUCache.rb

Around christmass time I lost alot of traction on programming projects
(mostly due to laziness combined with a dead laptop HDD), but now that
I’ve resurrected it, I’ll have to push Borges out the door.

···

Avi Bryant (avi@beta4.com) wrote:

How does Iowa store each continuation stack (which is my own, uneducated
term – same thing as the resident set size?) ? From my unscientific
checking of Borges, it seemed each continuation got its own place in
memory, so virtually every page visit triggered another usage chunk, and
it seemed to grow very quickly with just one user. If Eric’s reading
this (Borges author), maybe he can chime in with some more specifics.

Iowa (at least back when I first wrote it :wink: doesn’t use
continuations, although it’s still resource intensive compared to many
alternatives, because it stores a bunch of state for each page view.
But as Kirk shows, it stays within acceptable limits.

Chad Fowler and I were looking into Borges resource usage earlier
today, and it seems to be out of control - Chad was seeing about an
extra 1MB (!) of resident size per page view.

–
Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

It would seem advantagous for all to collectively
consider/define/provide use cases for, what IS a
web
application platform - and not necessarily how it
is
implemented - a path to WAP driven by consensus.
In my

For my purposes, I have a really simple definition.
A Web Application
Framework is a skeleton that takes care of all of
the yucky bits about

Sounds good to me…like user/content/workflow
management? A good ‘seperation of duties’. Programmer,
Admin,Editor etc

creating dynamic content – whether it be a single
page or a massive
application – so that I can concentrate on just
handling the important
things.

Like content or whatever particular task your up to.
No need to worry about the rest.

And important things boils down to code that handles
the actual
functionality of the page/app and a layout for what
is being returned to
the user, prefereably seperated from the code so
that the two can be
handled independently.

Amrita? kind of cook but i’ve tended to avoid template
systems. ruby scripting is (so easy/intuitive) maybe
just a little more sophisticated than a mark-up
language so why learn another? Maybe ERuby and just
sandbox a script/template?

···

— Kirk Haines khaines@enigo.com wrote:

On Wed, 4 Feb 2004, paul vudmaska wrote:


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

Heh. Your LRU cache looks pretty similar to mine. I ran into exactly the
same issue with the LRU cache in Iowa. Expired content never actually got
removed from the cache. Holy Creeping Memory Leak, Batman! In my case it
fortunately did not grow by a substantial amount with each pageview, but
over a little time or with a lot of hits the effects eventually became
debilitatingly apparent.

Kirk Haines

···

On Sat, 14 Feb 2004, Eric Hodel wrote:

There is a version of Borges floating about with a broken LRUCache. It
will consume approximately 1MB per page view, and never let go (ouch!).

See:

http://216.254.21.90/cgi-bin/cvsweb.cgi/ruby/seaside2/Borges/lib/Borges/Utilities/LRUCache.rb

Well, for my purposes, Iowa generally just uses regular HTML with an
extra attribute, ‘oid’. There are a few special tags like and
, and a special bit of syntax where @WORD where calls the method WORD
and inserts its return value. Also, one can insert other components by
importing them and refering to them much like an HTML tag. So, a few
differences from plain markup, but not much.

And the net result is that I can do things like this:

Ad tag summary as of: @current_time

  • @tag

And then in the seperate code file, the code would be:

<%
class AdTagSummary < Iowa::Component
attr_accessor :tag

def current_time
  Time.now.to_s
end

def tags
  r = []
  application.dbpool.getConnection do |dbh|
    sql = 'select distinct(origin_code) from ad_responses'
    dbh.select_all sql do |row|
      r.push row[0]
    end
  end
  r
end

end
%>

<? tagList { item = tag list = tags } ?>

The code is cleanly seperated from the presentation, allowing one to muck
with the presentation at will without worrying about the code, and the
markup is just plain HTML with a few special things, so the learning curve
is pretty low.

Kirk Haines

···

On Wed, 4 Feb 2004, paul vudmaska wrote:

Amrita? kind of cook but i’ve tended to avoid template
systems. ruby scripting is (so easy/intuitive) maybe
just a little more sophisticated than a mark-up
language so why learn another? Maybe ERuby and just
sandbox a script/template?

Seperation of duties(developers from designers) is
beneficial to all. My observation is that as scripting
languages become more intuitive/approachable it
might be helpful to turn their power over to
designers - if it can be done without jeapordizing the
integrity of the supporting system. Only with access
to variables that are pushed to the file for example.

I’m just setting forth something to consider. In
truth, i’m more of a designer, so maybe that’s why i
thot of the above. Templates are probably better. They
have a proven history.

···

— Kirk Haines khaines@enigo.com wrote:

On Wed, 4 Feb 2004, paul vudmaska wrote:

Amrita? kind of cook but i’ve tended to avoid
template
systems. ruby scripting is (so easy/intuitive)
maybe
just a little more sophisticated than a mark-up
language so why learn another? Maybe ERuby and
just
sandbox a script/template?

Well, for my purposes, Iowa generally just uses
regular HTML with an
extra attribute, ‘oid’. There are a few special
tags like and
, and a special bit of syntax where @WORD where
calls the method WORD
and inserts its return value. Also, one can insert
other components by
importing them and refering to them much like an
HTML tag. So, a few
differences from plain markup, but not much.

And the net result is that I can do things like
this:

Ad tag summary as of: @current_time

  • @tag

And then in the seperate code file, the code would
be:

<%
class AdTagSummary < Iowa::Component
attr_accessor :tag

def current_time
  Time.now.to_s
end

def tags
  r = []
  application.dbpool.getConnection do |dbh|
    sql = 'select distinct(origin_code) from

ad_responses’
dbh.select_all sql do |row|
r.push row[0]
end
end
r
end
end
%>

<? tagList { item = tag list = tags } ?>

The code is cleanly seperated from the presentation,
allowing one to muck
with the presentation at will without worrying about
the code, and the
markup is just plain HTML with a few special things,
so the learning curve
is pretty low.

Kirk Haines


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

The seperation is beneficial even when the developer and the designer are
the same person, IMHO. It helps keep the codebase more organized, it’s
harder to mess something up that one didn’t intend to change. Also,
syntax highlighting works better when HTML isn’t mixed with Ruby.

What you are talking about with access to variables that are pushed to the
file – what do you mean? Can you give me some sort of psuedocode example
to illustrate what you are thinking of?

Kirk Haines

···

On Wed, 4 Feb 2004, paul vudmaska wrote:

Seperation of duties(developers from designers) is
beneficial to all. My observation is that as scripting
languages become more intuitive/approachable it
might be helpful to turn their power over to
designers - if it can be done without jeapordizing the
integrity of the supporting system. Only with access
to variables that are pushed to the file for example.

Seperation of duties(developers from designers) is
beneficial to all. My observation is that as
scripting
languages become more intuitive/approachable it
might be helpful to turn their power over to
designers - if it can be done without jeapordizing
the
integrity of the supporting system. Only with
access
to variables that are pushed to the file for
example.

The seperation is beneficial even when the developer
and the designer are
the same person, IMHO. It helps keep the codebase
more organized, it’s
harder to mess something up that one didn’t intend
to change. Also,
syntax highlighting works better when HTML isn’t
mixed with Ruby.

I sure do agree.

What you are talking about with access to variables
that are pushed to the
file – what do you mean? Can you give me some sort
of psuedocode example
to illustrate what you are thinking of?

I’ll try. Just as Amrita has a data property that is
‘pushed’ to it.
data = {
:title => “a title”,
:body => “this body”
}
tmpl.expand(STDOUT, data)

but instead of…

title will be inserted here

body text will be inserted here

something like…

<%=data['title']%>

<%=data['body']%>

...just testing what i get for data <% data.each do |d| puts d end
       %>
 </body>

So, leave the heavy lifting to the developer but let
the designer play too.

:stuck_out_tongue:

···

— Kirk Haines khaines@enigo.com wrote:

On Wed, 4 Feb 2004, paul vudmaska wrote:


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

----“paul vudmaska” wrote:----

something like…

<%=data['title']%>

<%=data['body']%>

...just testing what i get for data <% data.each do |d| puts d end
       %>
 </body>

So, leave the heavy lifting to the developer but let
the designer play too.

This is essentially eruby.

http://modruby.net

···

–
John Long
http://wiseheartdesign.com

Exactly - i use eruby in lieu of Amrita for
presentation and/or content. Let me explain.

In a simple CMS system i’m creating, i have a ui that
allows the owner of the site to edit/create (static)
content on the fly. Then i started thinking that i’d
like to have some smarts in these files. Instead of
setting up a harnessing mechanism with Amrita, i added
a property to the content, executable, and if it is
on, i complile the text through the eruby compiler and
eval the code. Dangerous, i know, but it works
amazingly well so far. Now, I can create content as
well as logic on the fly. Right now, within these
files, the world is my oyster (read destruction zone
:).

My next step is sandboxing (perhaps safe level 4, i
dont know) and/or data injection(like Amrita) for
these files and/or only allowing developers(as opposed
to editors) to create an executable. I’ve also thot
about forcing these files thru some sort of simple
authorization process (there will be a simple work
flow anyway) where a developer/admin would need to
look at the code before it’s available/executable.
This has obvious advantages(and disadvantages), but it
also has one BIG advantage that is not immidiately
clear - i can compile the code with eruby and save
THAT, which is now pure ruby, into a supporting
table. So it is compiled only ONCE.

My view currently (it changes often :), is, why learn
a templating language when you can use eruby and some
basic but powerful ruby (for popping in vars/iterating
etc)? Keep in mind i dont expect these files to have a
lot of logic - theyre for presentation after all.

Interestingly, all of a sudden, i’m a few short steps
toward having something like zope - content/user
management, work flow, and to some extent, logic
creation from within the browser.

I’m kind of clued in to the dangers/folly of this, but
you guys out there that know better, rip me up!

PS: I’ve babbled quite a bit, I know, but since i’m
at it let me tell you a little more about the overall
system i’m building, why i started it etc.

I’m creating 3 sites currently. All for one customer.

I wanted

  1. To share code between them(for user and content mgt
    etc)
  2. To be able to have a different look and feel for
    each.

So the basics(it is simple!) are, for each site, i
have a config/data file(xml) and a template(eruby).
The config file holds things like what template to
use, admin email, contact info, default title/content,
toolbar items etc.

Adding a new site is trivial (one file in the root
with one line of code). It can have it’s own look and
feel or use the default. It has all the capabilities
needed to create the whole site through the browser.

The one thing missing from many of these Web
Application Platforms/Frameworks is the ability to
simply create websites - with content mgt and a common
look and feel. I’m not as interested in the webobjects
or j2ee platform/methodology as i am in creating sites
that are easy to build and maintain. For me, i guess
i’m more interested in a Web Site Platform - that i
can extend as i see fit. The above works pretty good
for me so far. I’d be interested in any constructive
crit you may have.

Paul

···

— “John W. Long” ng@johnwlong.com wrote:

----“paul vudmaska” wrote:----

something like…

<%=data['title']%>

<%=data['body']%>

...just testing what i get for data <% data.each do |d| puts d end
       %>
 </body>

So, leave the heavy lifting to the developer but
let
the designer play too.

This is essentially eruby.


Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html