It’s Like AJAX for Ruby and Python

EddieC 0 Tallied Votes 339 Views Share

If you’re a Ruby or Python developer building AJAX applications, you’ve got to learn JavaScript. Even if you’re converting Ruby code to client-side JavaScript with a tool like RJS, it can still be helpful to know the AJAX component for adding features and debugging.

Now Microsoft is promoting APAX and ARAX, techniques similar to AJAX that supplant JavaScript with Python and Ruby languages commonly used on the server side of the dynamic Web apps.

The news was brought to light last week at O’Reilly’s RailsConf by Microsoft’s John Lam, who was there giving a talk on his IronRuby project, and its progress toward running Rails. IronRuby is an implementation of the open source language that runs on Microsoft’s Common Language Runtime (CLR). RailsConf took place in Portland, Ore., May 29 to June 1.

Writing on his blog about the benefits of IronRuby beyond those of running Rails, Lam said “it lets you interact with the rich set of libraries provided by .NET. You’ll be able to use IronRuby to build server-based applications that run on top of ASP.NET or ASP.NET MVC... to build client applications that run on top of WPF or Silverlight… and to test, build and deploy your .NET applications.” Almost in passing, he also mentions the ability to run Ruby code in a Web browser and have it talk to Ruby code on a Web server. “That’s a feature that we feel that many folks will enjoy.” Um…yeah, I kinda think so too.

There’s just one problem: To run Python or Ruby on the browser, you’ll need SilverLight, Microsoft’s media player plug-in. "If this is about using Silverlight to host client-side browser scripting in Ruby, it's definitely an appealing notion,” said Ben Galbraith, co-founder of Ajaxian.com to developer-beat reporter Darryl K. Taft for an eWeek article. “ut the problem will always be about Silverlight being a Microsoft technology."

Maybe you’d be better off with HotRuby, a Ruby VM.

lkcl 0 Newbie Poster

"If you’re a Ruby or Python developer building AJAX applications, you’ve got to learn JavaScript. Even if you’re converting Ruby code to client-side JavaScript with a tool like RJS, it can still be helpful to know the AJAX component for adding features and debugging. "

agreed. now there's something that's equivalent of RJS for ruby: pyjamas - http://pyjs.org - which is a stand-alone python-to-javascript compiler and a convenient AJAX framework and widget set.

"To run Python or Ruby on the browser, you’ll need SilverLight, Microsoft’s media player plug-in."

no - you don't _need_ silverlight. there's PyDOM from mozilla: http://developer.mozilla.org/en/PyDOM which allows you to execute python code inside a browser, and access the DOM model.

then, also, for good measure, there's pykhtml and friends (and pykde's khtml.KHTMLPart) which again allows you to manipulate the DOM model of a KDE-framework-hosted HTML page;

then, also, there's pyjamas-desktop - http://pyjd.org - which uses python bindings to glib bindings to webkit (!) http://webkit.org

so there are almost half a dozen different options to run python in web technology, all of which, ironically, make better "desktop widget sets" than "desktop widget sets" such as pyqt4 and pygtk2 do, thanks to the underlying technology - web browser engines - being far more powerful and flexible.

commented: Helpful +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.