# Ruby in Browsers?

**URL:** <https://rubytalk.org/t/ruby-in-browsers/24700>\
**Category:** ruby-talk\
**Created:** [7 February 2006 15:58 UTC](https://rubytalk.org/t/ruby-in-browsers/24700 "2006-02-07T15:58:26Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petermichaux](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@Petermichaux](https://rubytalk.org/u/Petermichaux)\
**Post date:** [7 February 2006 15:58 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/1 "2006-02-07T15:58:26Z")

</div>

Hi,

I've had to start using JavaScript to make a DHTML interface. After  
learning Ruby I feel like I'm taking a giant step back in productivity  
and fun by using JavaScript. PITA.

Any moves out there to get Ruby imbeded in browsers?

How about Ruby as a client-side scripting web standard? (Maybe it would  
have to be Ruby Light with the file accessors removed.)

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![Gregory\_Seidman](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@Gregory\_Seidman](https://rubytalk.org/u/Gregory_Seidman)\
**Post date:** [7 February 2006 16:15 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/2 "2006-02-07T16:15:38Z")

</div>

} I've had to start using JavaScript to make a DHTML interface. After  
} learning Ruby I feel like I'm taking a giant step back in productivity  
} and fun by using JavaScript. PITA.

That probably means you are using it wrong. Or you are running up against  
cross-browser incompatibilities. JavaScript is a very nice language when  
used properly.

} Any moves out there to get Ruby imbeded in browsers?  
}  
} How about Ruby as a client-side scripting web standard? (Maybe it would  
} have to be Ruby Light with the file accessors removed.)

The biggest problem with JavaScript is incompatible APIs across browsers.  
Adding Ruby to the mix would only make cross-browser compatibility more  
difficult. Unless you could magically get everyone out there to  
simultaneously switch to a browser that provided client-side Ruby scripting  
in exactly the same way, it would only add to the mess.

If you really want client-side Ruby, start working on a  
Ruby-to-ActionScript (or Flash bytecode) compiler.

} Thanks,  
} Peter  
--Greg

> **···**
>
> On Wed, Feb 08, 2006 at 12:58:26AM +0900, [petermichaux@yahoo.com](mailto:petermichaux@yahoo.com) wrote:

---

<div class="post-metadata">

**Author:** ![Mark\_Somerville](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@Mark\_Somerville](https://rubytalk.org/u/Mark_Somerville)\
**Post date:** [7 February 2006 16:44 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/3 "2006-02-07T16:44:26Z")

</div>

> } I've had to start using JavaScript to make a DHTML interface. After  
> } learning Ruby I feel like I'm taking a giant step back in productivity  
> } and fun by using JavaScript. PITA.

I couldn't agree more. Writing Javascript is something I have no love for at  
all.

> That probably means you are using it wrong. Or you are running up against  
> cross-browser incompatibilities.

I could well be using it wrong. Maybe it is the browser inconsistencies. Maybe  
it's because I find it a horror to debug. Whatever it is, It's a car crash of  
a technology for me.

Mark

> **···**
>
> On Wed, Feb 08, 2006 at 12:58:26AM +0900, petermichaux@yahoo.com wrote:  
> On Tuesday 07 February 2006 16:15, Gregory Seidman wrote:
> 
> > JavaScript is a very nice language when  
> > used properly.
> > 
> > } Any moves out there to get Ruby imbeded in browsers?  
> > }  
> > } How about Ruby as a client-side scripting web standard? (Maybe it would  
> > } have to be Ruby Light with the file accessors removed.)
> > 
> > The biggest problem with JavaScript is incompatible APIs across browsers.  
> > Adding Ruby to the mix would only make cross-browser compatibility more  
> > difficult. Unless you could magically get everyone out there to  
> > simultaneously switch to a browser that provided client-side Ruby scripting  
> > in exactly the same way, it would only add to the mess.
> > 
> > If you really want client-side Ruby, start working on a  
> > Ruby-to-ActionScript (or Flash bytecode) compiler.
> > 
> > } Thanks,  
> > } Peter  
> > --Greg

---

<div class="post-metadata">

**Author:** ![Petermichaux](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@Petermichaux](https://rubytalk.org/u/Petermichaux)\
**Post date:** [8 February 2006 00:38 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/4 "2006-02-08T00:38:21Z")

</div>

> The biggest problem with JavaScript is incompatible APIs across browsers.  
> Adding Ruby to the mix would only make cross-browser compatibility more  
> difficult. Unless you could magically get everyone out there to  
> simultaneously switch to a browser that provided client-side Ruby scripting  
> in exactly the same way, it would only add to the mess.

What if the ruby community supplied the browser makers with a single  
interpreter that they could plug in? Yes it might take a few years for  
this to take wide spread effect but some applications can dictate the  
user's browser. I'm working on one right now. These apps could go Ruby  
earlier.

---

<div class="post-metadata">

**Author:** ![Michal\_Suchanek](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Michal\_Suchanek](https://rubytalk.org/u/Michal_Suchanek)\
**Post date:** [8 February 2006 10:13 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/5 "2006-02-08T10:13:56Z")

</div>

That would be a great step back in compatibility. While you can  
compile Mozilla or Konqueror for almost any platform you choose, and  
both support JavaScript, the support for Flash is much worse.  
Flash is a proprietary technology, and the binary plugin to interpret  
it is available only for a handful of platforms. You can use it on OS  
X, win32, possibly win64 and wince, and x86 Linux. It is quite likely  
it will work in emulation on x86 NetBSD or x86\_64 Linux. But GNU/Linux  
on ppc, mips, alpha, Solaris on anything, or any other OS is quite  
hopeless.  
There is a free flash player in which next to nothing works, and I am  
not even sure it works as a browser plugin.  
I do not know waht is ActionScript. The situation with Java plugin is  
similar except Sun makes a version for Solaris as well.

So I do not see any cross-platform browser scripting other than JavaScript.

Thanks

Michal

> **···**
>
> On 2/7/06, Gregory Seidman \<gsslist+ruby@anthropohedron.net\> wrote:
> 
> > The biggest problem with JavaScript is incompatible APIs across browsers.  
> > Adding Ruby to the mix would only make cross-browser compatibility more  
> > difficult. Unless you could magically get everyone out there to  
> > simultaneously switch to a browser that provided client-side Ruby scripting  
> > in exactly the same way, it would only add to the mess.
> > 
> > If you really want client-side Ruby, start working on a  
> > Ruby-to-ActionScript (or Flash bytecode) compiler.
> 
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Support the freedom of music!  
> Maybe it's a weird genre .. but weird is \*not\* illegal.  
> Maybe next time they will send a special forces commando  
> to your picnic .. because they think you are weird.  
> [www.music-versus-guns.org](http://www.music-versus-guns.org)[http://en.policejnistat.cz](http://en.policejnistat.cz)

---

<div class="post-metadata">

**Author:** ![Jeff\_Barczewski](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@Jeff\_Barczewski](https://rubytalk.org/u/Jeff_Barczewski)\
**Post date:** [7 February 2006 17:25 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/6 "2006-02-07T17:25:40Z")

</div>

I agree, it would be nice if ruby could be used locally on the client as  
seamlessly as javascript.

In the meantime there is a project called [http://www.kavascript.com/](http://www.kavascript.com/) which  
provides a way to write psudo ruby, run it through a compile step and  
generate javascript. This would probably only work for standalone javascript  
files and not embedded javascript. I don't know whether the benefits  
outweigh the extra compilation step, but it is worth a try to see. I can't  
comment further on the robustness of this project, nor have I used it yet  
myself, but if you try it out maybe you can post something back to the list  
about your experience.

Blessings,

Jeff

---

<div class="post-metadata">

**Author:** ![Jon\_Smirl](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Jon\_Smirl](https://rubytalk.org/u/Jon_Smirl)\
**Post date:** [7 February 2006 21:10 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/7 "2006-02-07T21:10:42Z")

</div>

Venkman Javascript debugger makes things much easier in FIrefox.

> **[Venkman](https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Venkman)**
>
> Venkman is the code name for Mozilla's JavaScript Debugger. It aims to provide a powerful JavaScript debugging environment for Mozilla based browsers namely Firefox, Netscape 7.x/9.x and SeaMonkey. Note that it is not included in the Gecko-based...

The Web Developer extension is also useful:  
[http://chrispederick.com/work/webdeveloper/](http://chrispederick.com/work/webdeveloper/)

> **···**
>
> --  
> Jon Smirl  
> [jonsmirl@gmail.com](mailto:jonsmirl@gmail.com)

---

<div class="post-metadata">

**Author:** ![Paul\_Stadig](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Paul\_Stadig](https://rubytalk.org/u/Paul_Stadig)\
**Post date:** [8 February 2006 01:08 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/8 "2006-02-08T01:08:22Z")

</div>

I've toyed with the idea of writing a plug-in for web browsers that  
allowed you to run "Ruby Applets." The most primitive idea would be to  
just call the Ruby intepreter whenever it encountered a .rb download or  
an \<embed\> or whatever the kids are using nowadays.

A more sophisticated version could provide some interface to the  
browser objects. Security would be nice.

Is there any such project out there?

Paul

petermichaux@yahoo.com wrote:

> **···**
>
> > What if the ruby community supplied the browser makers with a single  
> > interpreter that they could plug in? Yes it might take a few years for  
> > this to take wide spread effect but some applications can dictate the  
> > user's browser. I'm working on one right now. These apps could go Ruby  
> > earlier.

---

<div class="post-metadata">

**Author:** ![MenTaLguY1](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@MenTaLguY1](https://rubytalk.org/u/MenTaLguY1)\
**Post date:** [8 February 2006 16:29 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/9 "2006-02-08T16:29:27Z")

</div>

Quoting Michal Suchanek \<hramrach@gmail.com\>:

> I do not know what is ActionScript.

ActionScript is Flash's embedded dialect of ECMAScript (i.e.  
JavaScript). In actual .swf files, it's bytecode rather than raw  
text, though.

-mental

---

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [8 February 2006 21:40 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/10 "2006-02-08T21:40:08Z")

</div>

Dňa Streda 08 Február 2006 11:13 Michal Suchanek napísal:

> \> The biggest problem with JavaScript is incompatible APIs across browsers.  
> \> Adding Ruby to the mix would only make cross-browser compatibility more  
> \> difficult. Unless you could magically get everyone out there to  
> \> simultaneously switch to a browser that provided client-side Ruby  
> \> scripting in exactly the same way, it would only add to the mess.  
> \>  
> \> If you really want client-side Ruby, start working on a  
> \> Ruby-to-ActionScript (or Flash bytecode) compiler.
> 
> That would be a great step back in compatibility. While you can  
> compile Mozilla or Konqueror for almost any platform you choose, and  
> both support JavaScript, the support for Flash is much worse.  
> Flash is a proprietary technology, and the binary plugin to interpret  
> it is available only for a handful of platforms. You can use it on OS  
> X, win32, possibly win64 and wince, and x86 Linux. It is quite likely  
> it will work in emulation on x86 NetBSD or x86\_64 Linux. But GNU/Linux  
> on ppc, mips, alpha, Solaris on anything, or any other OS is quite  
> hopeless.  
> There is a free flash player in which next to nothing works, and I am  
> not even sure it works as a browser plugin.  
> I do not know waht is ActionScript. The situation with Java plugin is  
> similar except Sun makes a version for Solaris as well.
> 
> So I do not see any cross-platform browser scripting other than JavaScript.
> 
> Thanks
> 
> Michal

Personally, I'd murder if I could get away with either an Applet or Flash more  
often. The proprietary bit -is- a pain, but at least you get something of a  
consistent interface instead of the godawful mess of browser inconsistencies  
that are out there. Admittedly less than there used to be, but you can and  
should still expect bugs with basic issues even when you have to support IE6,  
which happily selectively ignores W3C standards with reckless abandon. The  
less-than-easy-reading browser documentation doesn't really help either. And  
don't even get me started on box models, the way any JS brings Konqueror to a  
grinding halt, and proprietary specialised set-top-box web browsers with  
completely random (non-)support of features.

David Vallner

> **···**
>
> > On 2/7/06, Gregory Seidman \<gsslist+ruby@anthropohedron.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Guillaume\_Marcais1](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Guillaume\_Marcais1](https://rubytalk.org/u/Guillaume_Marcais1)\
**Post date:** [8 February 2006 03:18 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/11 "2006-02-08T03:18:36Z")

</div>

Paul Stadig wrote:

> I've toyed with the idea of writing a plug-in for web browsers that  
> allowed you to run "Ruby Applets." The most primitive idea would be to  
> just call the Ruby intepreter whenever it encountered a .rb download or  
> an \<embed\> or whatever the kids are using nowadays.
> 
> A more sophisticated version could provide some interface to the  
> browser objects. Security would be nice.
> 
> Is there any such project out there?

Maybe a source of inspiration can be the TCL plugin ([URL Not Found](http://www.tcl.tk/software/plugin/%5C)). But if I remember some discussion in TCL conferences, to get browser manufacturer to include this particular plug-in was just a pie in the sky, and installing a plug-in to see a web site seems too high of a hurdle for many (most?) average users.

Don't get discouraged by it though. Go out and embed ruby in a plug-in if you feel the urge. It could in did be a lot of fun!

Guillaume.

> **···**
>
> > Paul
> > 
> > petermichaux@yahoo.com wrote:
> > 
> > > What if the ruby community supplied the browser makers with a single  
> > > interpreter that they could plug in? Yes it might take a few years for  
> > > this to take wide spread effect but some applications can dictate the  
> > > user's browser. I'm working on one right now. These apps could go Ruby  
> > > earlier.

---

<div class="post-metadata">

**Author:** ![Tsume](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@Tsume](https://rubytalk.org/u/Tsume)\
**Post date:** [8 February 2006 05:04 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/12 "2006-02-08T05:04:58Z")

</div>

> I've toyed with the idea of writing a plug-in for web browsers that  
> allowed you to run "Ruby Applets." The most primitive idea would be to  
> just call the Ruby intepreter whenever it encountered a .rb download or  
> an \<embed\> or whatever the kids are using nowadays.
> 
> A more sophisticated version could provide some interface to the  
> browser objects. Security would be nice.

We still need to get rid of the white elephant which is standing in the middle  
of the room. yes, you know the one.. the one which beats the 800lb ugly  
gorilla, the slow side of ruby. I think this is a need before any type of  
applet interface is made, and even so, one will need to create or use some  
type of custom toolkit which can be added with a nice API. A Tk based  
solution would be good since it works everywhere.

> Is there any such project out there?
> 
> Paul

Tsume

> **···**
>
> On Wednesday 08 February 2006 10:08 am, Paul Stadig wrote:

---

<div class="post-metadata">

**Author:** ![Anibal](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Anibal](https://rubytalk.org/u/Anibal)\
**Post date:** [8 February 2006 11:23 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/13 "2006-02-08T11:23:22Z")

</div>

Thanks a lot for those pointers!

Aníbal Rojas  
[http://www.lacaraoscura.com/](http://www.lacaraoscura.com/)  
[http://www.vp.com.ve/](http://www.vp.com.ve/)

---

<div class="post-metadata">

**Author:** ![Paul\_Stadig](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Paul\_Stadig](https://rubytalk.org/u/Paul_Stadig)\
**Post date:** [8 February 2006 14:58 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/14 "2006-02-08T14:58:22Z")

</div>

I wouldn't be interested in getting browser manufacturers to include  
the plug-in immediately. It would be rare to get something that would  
have a hard takeoff like that. The idea would be to do something  
similar to Java and the Java plug-in. If people like it then they use  
it. If they don't, then whatever. If it get's popular, then maybe the  
browser manufacturers would include it.

In cases where a person has control over such things they could use  
Ruby and the Ruby plug-in instead of Java. In other cases, use Java or  
something that the browser manufacturers include automatically. I just  
thought it would be a cool idea. It seems possible. It would be one way  
to escape from Java hell.

Paul

---

<div class="post-metadata">

**Author:** ![Gonzalo\_Rubio](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@Gonzalo\_Rubio](https://rubytalk.org/u/Gonzalo_Rubio)\
**Post date:** [8 February 2006 15:33 UTC](https://rubytalk.org/t/ruby-in-browsers/24700/15 "2006-02-08T15:33:24Z")

</div>

Paul Stadig wrote:

> I wouldn't be interested in getting browser manufacturers to include  
> the plug-in immediately. It would be rare to get something that would  
> have a hard takeoff like that. The idea would be to do something  
> similar to Java and the Java plug-in. If people like it then they use  
> it. If they don't, then whatever. If it get's popular, then maybe the  
> browser manufacturers would include it.
> 
> In cases where a person has control over such things they could use  
> Ruby and the Ruby plug-in instead of Java. In other cases, use Java or  
> something that the browser manufacturers include automatically. I just  
> thought it would be a cool idea. It seems possible. It would be one way  
> to escape from Java hell.
> 
> Paul

or may be if someone follows the idea for Ruby 2.0 to compile into Java  
Bytecode it would be directly supported into browsers.  
I know Matz said Rite won't generate Java Bytecode, but there are people  
out there that want to follow that path.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
