{"repo":"opal/opal","free":true,"listed":false,"github":"https://github.com/opal/opal","clone":"git clone https://github.com/opal/opal.git","description":"Ruby ♥︎ JavaScript","language":"Ruby","stars":4927,"topics":["ruby","opal","javascript","compiler","js","browser","nodejs"],"license":"MIT","category":"dev-tools","readme_excerpt":"Opal Opal is a Ruby to JavaScript source-to-source compiler, shipping with an implementation of the Ruby corelib and stdlib. Write Ruby, run it anywhere JavaScript runs — the browser, Node.js, Deno, Bun, QuickJS. Why Opal - A real Ruby implementation. Opal ships its own corelib and stdlib and is validated against [ruby/spec][ruby-spec], the same suite CRuby uses. A JavaScript host imposes limits — those are catalogued in Unsupported Features. - Source-to-source, no runtime interpreter. Ruby compiles to plain JavaScript ahead of time, so there is no VM to download and no interpreter loop at runtime. - Two-way JavaScript interop. Call JS from Ruby and Ruby from JS, and treat native JS classes as Ruby ones. See [Interfacing with JavaScript][js-interface]. - Share code between server and client. The same gem, the same objects, the same specs, on both sides of the wire. - It compiles itself. The compiler is written in Ruby and builds to opal-parser.js , so it also runs inside the browser. Installation Opal needs Ruby. The gemspec declares = 2.3 ; CI exercises Ruby 3.0 through 4.0 and JRuby, so 3.x or newer is the sensible choice. Or in your Gemfile : This installs the latest release, from the 1.8 series. The master branch is 2.0.0dev and is not yet released; to track it: Then check it: The second command prints Hello from Opal — it compiled the Ruby and ran the result on Node.js. Documentation - Guides — tutorial, how-to guides, reference, and explanation, also rendered at opalrb.","default_branch":null,"files":null,"tree":[],"storefront":"/r/opal","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/opal/opal/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}