InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Wee: Continuation Based Ruby Web Framework

Posted by Mirko Stocker on Mar 24, 2009

Sections
Development
Topics
Ruby ,
Web Frameworks
Tags
Continuations ,
Seaside ,
Ruby1.9

Wee (web engineering easy) is a Seaside like web framework that uses continuations and lets the developer "get the job done quick and beautiful", as its developer Michael Neumann writes. Wee also has reusable components, "which are like widgets in a GUI. Once written, you can use them everywhere", targeting componentized HTML GUI applications, rather than RESTish ones. The approaching 2.0 release will also be fully Rack based.

Neumann's blog post about Wee shows some examples how much more readable code with continuations can be. With continuations, a simple sequential flow can be written as:

 callcc page1
 callcc page2
 callcc page3

Compare this to the alternative, written in continuation passing style:

 call page1 do
   call page2 do
     call page3
   end
 end

If continuations are so useful, why isn't every framework using them? A reason why there aren't more continuation based web frameworks for Ruby is certainly that continuations in Ruby 1.8 leak memory. Although Brent Roman's MBARI patches fix the memory leak, they aren't yet in the official Ruby 1.8 series (they might get included once Engine Yard assumes the maintenance). With Ruby 1.9.1, the memory leaks are also gone and Wee takes advantage of that:

For 10000 requests (with one thread) Ruby 1.9.1 takes 16 seconds and requires 12 MB of memory. The same example with Ruby 1.8.7 grows to 329 MB of memory and takes 56 seconds

Wee seems to be a good reason to start switching to Ruby 1.9 and also an interesting alternative to Rails, now that Merb will be merged into Rails 3.0.

git repository does not include all files? by G Cao Posted
Re: git repository does not include all files? by Mirko Stocker Posted
Re: git repository does not include all files? by G Cao Posted
  1. Back to top

    git repository does not include all files?

    by G Cao

    I cloned git repository and was able to run examples/demo.rb However when I run examples/ajax.rb, it requires lib/jquery/jquery which seems not existing. Does git repository miss some files?

  2. Back to top

    Re: git repository does not include all files?

    by Mirko Stocker

    Does git repository miss some files?


    I'd contact the author of Wee, Michael Neumann.

  3. Back to top

    Re: git repository does not include all files?

    by G Cao

    Just emailed him. Thanks.

Educational Content

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?