Why not make Opal default for Rails?

Hello People,

I just read this blog post

Rails started with a mission to make web development easy. Part of its
strategy is to bring Ruby to masses so that tasks that were tough till
became a breeze. Now most applications are moving to javascript, a
language that is not liked by many Ruby people because Ruby is elegant.

Rails has answered this problem a bit by making coffeescript as
but I feel keeping everything ruby like will make it better. There is
project called Opal http://opalrb.org/ which I am following, and I feel
will be great if Rails has this as its default say from Rails 5 or some

What you people feel about this idea, will it change the universe or it
just sucks?


Karthikeyan A K

It just sucks.

I would be opposed to this. In fact, I don’t really like having CS as
default, though I use it for preference, for the same reason:
not anything else, is the de facto language of the client side.
should be the default.

CS as a default isn’t so bad as it is designed primarily to expose ‘the
good parts’ of JS in a syntactically cleaner format. How close it gets
JS is another matter, but 90% of basic code you write in CS will come
as recognisable JS. Ruby is *not *nearly as similar to JS as CS; your
code might look pretty going in, but the more ‘Rubyish’ your Ruby, the
uglier and harder to maintain the resulting JS will be. (Even transpiled
takes a bit of getting used to, especially if you’re using the class

There is a great explosion of compile-to-JS projects happening at the
moment, some of which is very interesting; but Rails’s purpose isn’t (or
shouldn’t be) to make web development easier for Ruby people, but to
up development of real-world web projects as such. That means favouring
lingua franca of the client side where possible. Does Opal play nicely
Jquery? Backbone, Ember, Angular, Underscore, Handlebars … ? I know
language that certainly does, with no hiccups: *Javascript. *If the
is front to back Javascript, which I don’t really think it is, then you
need to know Javascript - simple as.

Of course, it’s pretty minor, since adding or removing any compile-to-JS
thing you require is simply a matter of changing a line in the Gemfile.