Steve, give me a late christmas present Enterprise guy that get the complexity
Jan 10

Yes Ruby in the Browser, No it won’t take off?

JavaScript, Ruby, Tech Add comments

Obie Fernandez wants No Ruby in the Browser, after Paul Hammant discussed it in Ruby vs. JavaScript for Web 3.0.

I am actually a fan of JavaScript these days. It isn’t as evil as you think.

However, I would love to have Ruby integrated as well as JavaScript it.

We could then have true libraries, and if we could version them all within the browser etc, we could share them between apps so we don’t duplicate painful downloads (not that we can’t add this to JS, but we could use rubygems).

Having true packages and namespaces, and a full environment like ruby in which we can share code in both worlds would be great. No need for Ruby to JSON etc. Send Ruby on down.

The reality is that it would be hard to get the ball rolling. JavaScript is part of the majority of browser suites, including the Flash VM, and getting groundswell around a Ruby plugin would be tough.

But in another dimension Marc A put Ruby into Netscape and we are all happy.

6 Responses to “Yes Ruby in the Browser, No it won’t take off?”

  1. Sam Pullara Says:

    You would really need something with built in security like the JavaVM. It would be awesome if you had a callback that gave you the DOM for the page and let you manipulate it. You could then use JRuby, JPython, or even just Java at that point. It always surprised me that applets didn’t have this capability…

  2. Brian Says:

    Replacing JS with a generic interpreter would be cool. The JVM would be great, but anything that allowed multiple languages to replace JS would work for me.

  3. Gary Says:

    You can get your ruby on in the browser already… to a limited extend. See http://www.kavascript.com.

  4. mikepk Says:

    It doesn’t provide everything you’re asking for, but my new javscript library/framework (yajaf.blogspot.com) does incorporate a packaging / dynamic code loader component. I think it’s one of the things that makes mine different and I’m considering opening it up. Alas, I can’t seem to get enough interest in it. I’m looking for interest and feedback from potential users to see if I should finish my developer tool.

  5. Nathan Says:

    Well, if anyone’s still interested in this, I’m putting my project of this type into SourceForge over the new few days (project name BrowserScripting). It’s not exclusively a JRuby-centric engine (currently have BeanShell and Pnuts working, JudoScript and JACL in the works).

    It has DOM manipulation (including stylsheet manipulation) and the beginnings of HTML events (mouse clicks, etc.)

    It currently works fairly well under FireFox and IE – Opera, Safari and Chrome have a few deal-breaking issues I’m trying to work through, and I haven’t been able to test Konqueror at all.

    With regards to Sam’s post, Jython is not possible, as it uses real-time bytecode compilation which is expressly blocked (via ClassLoader) by the JVM. Using a signed applet is NOT a solution, as this would open the door to some serious security problems (scripts would have unrestricted access to the user’s PC). The same holds true for Groovy (unfortunately).

    As part of this project, I have an ANT build which unpacks the standard JRuby JAR file, removes “unneeded” files and classes (such as file I/O), and re-packages it. By additionally applying Pack200 to the result, the JRuby JAR has been reduced to 1.2MB (as opposed to the nearly 8MB of the original JAR).

    If anyone is interested, I will try to keep the SourceForge project updated.

  6. ppibburr Says:

    so, i have a webkit in a ruby-gtk2 app. the DOM is exposed and so are events

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?