Earlier quoted context omitted.
There's something to be said for writing the client and server app using the same language. Node.js serves a similar use case.
What is the thing to be said?
Opal: Ruby to JavaScript Compiler
21–30 of 69 posts
Re: Opal: Ruby to JavaScript Compiler
#22afaik,it's not really a ruby to javascript compiler(like coffeescript compiles down to js). You cant write xhr = XMLHttpRequest.new and expect it to compile in js.without importing some libs.
Ruby, however, is not just a thin layer over JS the way CoffeeScript is. The thing you are referring to is a sign of CoffeeScript being a thin layer over JS, not CoffeeScript's compiler being a "real compiler".
Re: Opal: Ruby to JavaScript Compiler
#23Earlier quoted context omitted.
Ruby aficionado programmers who think coffeescript is too pythony perhaps? :)
As DouweM said; there is a case to be made for having the whole stack in a single language. While I use different languages server side, Ruby (either with Rails or Sinatra) is my go to option more often than not these days. I have used CoffeeScript extensively, but this has always been on contracts where the decision was made by someone else. It is important to learn and use real JavaScript (IMHO) rather than all of…
Re: Opal: Ruby to JavaScript Compiler
#24Also, is it possible that something won't translate from ruby --> js and cause a bug?
Re: Opal: Ruby to JavaScript Compiler
#25Earlier quoted context omitted.
What is the thing to be said?
Sorry if you were attempting to troll but if not 'there is something to be said about..' is a phrase which translates along the lines of 'there are definitely good things that could be said about..'
Re: Opal: Ruby to JavaScript Compiler
#26How do people know that one lang would compile down to another? Is there something about the lang that make this possible? Also, is it possible that something won't translate from ruby --> js and cause a bug?
Re: Opal: Ruby to JavaScript Compiler
#27How do people know that one lang would compile down to another? Is there something about the lang that make this possible? Also, is it possible that something won't translate from ruby --> js and cause a bug?
Ruby and JS are both Turing-complete languages (as with just about any other programming language you'll ever use), which means that one can simulate the other. The simulation might be messy, complicated, or slow, but it will still work. In this case, Ruby and JS are close enough that it can be done without too much trouble (see the compiled JS).
Re: Opal: Ruby to JavaScript Compiler
#28Earlier quoted context omitted.
As DouweM said; there is a case to be made for having the whole stack in a single language. While I use different languages server side, Ruby (either with Rails or Sinatra) is my go to option more often than not these days. I have used CoffeeScript extensively, but this has always been on contracts where the decision was made by someone else. It is important to learn and use real JavaScript (IMHO) rather than all of…
>I have used CoffeeScript extensively, but this has always been on contracts where the decision was made by someone else. >It is important to learn and use real JavaScript (IMHO) rather than all of these transpiled languages. This is the route I take when I have a choice on the client side; I use JavaScript. I've been using Rails and Coffeescript. Intuitively, I feel like using Javascript directly would be better som…
Personally, I don't really see much of a downside to JS transpiled languages. You are already working with a high-level scripting language. The incredible amount of benefits you gain from using something like Coffeescript or Typescript far exceed any negligible downside to them.
(You do have to trust that the transpiled language is good however. You don't want to accidentally start using a bad language that fails to transpile or is simply harder to work with than native js. With Coffeescript/Typescript being very popular, I would consider them both "safe".)
Re: Opal: Ruby to JavaScript Compiler
#29afaik,it's not really a ruby to javascript compiler(like coffeescript compiles down to js). You cant write xhr = XMLHttpRequest.new and expect it to compile in js.without importing some libs.
It is really a ruby to JS compiler. Ruby, however, is not just a thin layer over JS the way CoffeeScript is. The thing you are referring to is a sign of CoffeeScript being a thin layer over JS, not CoffeeScript's compiler being a "real compiler".