Live data from Hacker News

Opal: Ruby runtime and library on top of Javascript

github.com

1–10 of 14 posts

Re: Opal: Ruby runtime and library on top of Javascript

#7
post #4

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.

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...

Re: Opal: Ruby runtime and library on top of Javascript

#9
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.).

Post reply on HN