From: itsme213 Date: 2005-01-21T15:30:59+09:00 Subject: Re: Ta-da list (Was: Re: OSCON Call For Proposals Now Open) "Douglas Livingstone" wrote in message > If you want to have a "normal" text interface, and a JS "rich" > one, it means you have to code everything twice. You need to have JS > which can manipulate HTML on the client side, plus Ruby on the server > side to generate exactly the same HTML! Or, someone smart could use Ryan's parse tree to write a translator from some subset of Ruby to Javascript. Write in Ruby, debug in Ruby or generate Javascript to debug rich-browser behaviors. Deploy to run on client with generated Javascript, or on server with Ruby. def conditional1(arg1) if arg1 == 0 then return 1 end return 0 end becomes in parse-tree: [:defn, :conditional1, [:scope, [:block, [:args, :arg1], [:if, [:call, [:lvar, :arg1], :==, [:array, [:lit, 0]]], [:return, [:lit, 1]], nil], [:return, [:lit, 0]]]]] becomes in Javascript roughly: function conditional1 (arg1) { if (arg1 == 0) then { return 1; } else { return(0); } } Feasible? Who knows ... Florian wrote an awesome library that shows that Javascript with prototypes and closures can do quite a few things that Ruby's objects and procs can do, putting a very useful chunk of core Ruby libraries into Javascript to wit. A Quiz candidate?