Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting Ruby 1.9.2 code to JavaScript?

Is it possible to convert Ruby code to Javascript at all? I have heard of RubyJS but this appears to not work with Ruby 1.9.2 - is this the case?

like image 207
AndyNico Avatar asked Jun 02 '11 12:06

AndyNico


3 Answers

It seems to me that Opal is the best Ruby to JavaScript converter/compiler out there right now. You can see it in action here.

It isn't perfect, but it works in most cases and unlike older projects such as RubyJS, Opal is still being actively developed. (Check out Opal on Github)

like image 82
Ajedi32 Avatar answered Nov 03 '22 04:11

Ajedi32


List of languages that compile to JS...

like image 3
sheldonh Avatar answered Nov 03 '22 03:11

sheldonh


There are many efforts that have tried to do this, but most have only been to an academic degree. For instance, this Ruby 1.9.2 VM in JavaScript.

Most efforts to port to JavaScript focus on the Google V8 engine and not necessarily the browser-side equivalent.

like image 2
tadman Avatar answered Nov 03 '22 02:11

tadman