

Opal: Ruby runtime and library on top of Javascript - orangea
https://github.com/adambeynon/opal

======
julius
I have been using a similar project (Red) for a year in production.

Here is why we wanted to use it:

\- Development speed (ruby can be typed so much faster and has a class system)

\- Packaging system (we want one minified js-file)

\- Code reuse (we use Ruby in the backend)

Here is why we stopped using it in favour of native JS:

\- Slow runtime (try to read some big JSON in your favourite js-ruby, we had
time diffs of 20secs to 0.2secs native js speed)

\- Debugging (this is the most annoying thing, which you will not realize in
the beginning)

\- Development speed (recompiling time increases the more accurate the ruby
implementation gets - my fork actually used multiple cpu cores)

\- Red was immature (had my own totally rewritten fork going...)

I still love projects like this, but the mentioned problems will not all go
away any time soon (a few of them might).

By the way, CoffeeScript shares some of these downsides, but is far less of a
pain, because the whole language was designed with JS in mind (fast
compilation, fast runtime etc.).

~~~
DanielRibeiro
Actually, as stated on Coffescript's wiki[1], there are many other
implementations of ruby on JS:

    
    
        * HotRuby Runs opcode, compiled by YARV on Ruby inside a web browser or in Flash.
    
        * rb2js Converts Ruby to JavaScript.
    
        * Red Writes like Ruby and runs like JavaScript
    
        * Quby Used for game coding site, not open source.
    
        * Opal Ruby to Javascript compiler.
    

It seems interesting that nobody has tried to use Rubinius (which tries to
implement _Ruby in Ruby_ ) to leverage any of these implementations, possibly
reusing a JIT mechanism.

[1] [https://github.com/jashkenas/coffee-script/wiki/List-of-
lang...](https://github.com/jashkenas/coffee-script/wiki/List-of-languages-
that-compile-to-JS)

------
blueskey52
Looks like a cool project, but it would be nice if the docs were a little more
complete or there was a try it out feature like on
<http://jashkenas.github.com/coffee-script/>

~~~
adambeynon
Docs are definitely being worked on, kinda the top priority now that the
language and runtime are pretty stable.

------
DrCatbox
What does it mean when something is 'on top of' another thing in computing?

~~~
orta
In cases like this it means that the language was built to compile down into
the other language. So you can write ruby code andnthat spits out JavaScript
for thte browser to read.

Same thing with coffee script / objective-j

------
benatkin
I can't tell what .rb is intended to run on the ruby interpreter, what .rb is
intended to run with Opal, and what .rb is intended to run on both.

~~~
india
Opal seems to be compiling the rb file to a js file. This js along with the
supplied opal.js will run in the browser.

Check out
[https://github.com/adambeynon/opal/tree/master/examples/brow...](https://github.com/adambeynon/opal/tree/master/examples/browser)

------
pforpal
is there an associated product or project that this was developed along with?
I am curious as to how this is being used

~~~
adambeynon
Im using it for an internal project. There is an associated `vienna` gem, that
is for building rich web apps (think sproutcore, cappuccino). It is not open
source yet, but will be once the project its been written for is finished.

------
juiceandjuice
Thought this was gonna be this: <http://www.opalvoip.org/>

~~~
buster
Thought this was gonna be this:
<http://en.wikipedia.org/wiki/Opal_(programming_language)>

------
rawsyntax
Interesting that it has partial node.js compatibility

