Opal
opalrb.com
What it is
Opal is a Ruby-to-JavaScript source-to-source compiler that converts Ruby ahead of time into plain JavaScript, without a runtime interpreter. It includes implementations of Ruby core and standard libraries. Ruby code can call JavaScript, JavaScript can call Ruby, and native JavaScript classes can be treated as Ruby classes. The project describes sharing a gem, objects, and specs between server and client code.
Opal can run in browsers and JavaScript environments including Node.js, Deno, Bun, and QuickJS. For its upcoming 2.0 release, the project lists current and previous stable Firefox, Chrome, Safari, and Edge as supported, while Internet Explorer is unsupported. That release targets ES2021 and has no transpilation fallback for older JavaScript engines. Listed integrations include Rails, Sinatra, Roda, and static apps; the Rails example uses opal-rails and requires opal_ujs and turbolinks. Installation is through `gem install opal` or by adding the gem to a Gemfile. The gemspec declares Ruby >= 2.3, and CI exercises Ruby 3.0 through 4.0 and JRuby. Opal is MIT-licensed and free, with CLI and API access. Support channels include Slack, Stack Overflow’s #opalrb tag, and GitHub issues.
Spec sheet
- What it does
- Opal is a Ruby-to-JavaScript source-to-source compiler that includes an implementation of Ruby corelib and stdlib.Read 7 Oct 2026 · github.com
- Support
- The project directs users to Slack, Stack Overflow with the #opalrb tag, and GitHub issues for bugs and feature requests.Read 7 Oct 2026 · github.com
- License
- Opal is released under the MIT License.Read 7 Oct 2026 · opalrb.com
- Browsers
- For the upcoming 2.0 release, the project lists current and previous stable Firefox, Chrome, Safari, and Edge as supported and says Internet Explorer is unsupported.Read 7 Oct 2026 · github.com
- Code sharing
- The project describes using the same gem, objects, and specs on both the server and client.Read 7 Oct 2026 · github.com
- Compilation
- Opal compiles Ruby to plain JavaScript ahead of time, without a runtime interpreter.Read 7 Oct 2026 · github.com
- Execution targets
- The project says Opal can run in browsers and in JavaScript environments including Node.js, Deno, Bun, and QuickJS.Read 7 Oct 2026 · github.com
- Framework integrations
- The project lists integrations for Rails, Sinatra, Roda, and static apps.Read 7 Oct 2026 · github.com
- JavaScript interop
- Opal supports calling JavaScript from Ruby and Ruby from JavaScript, and treating native JavaScript classes as Ruby classes.Read 7 Oct 2026 · github.com
- Maker details
- The opened official pages identify Adam Beynon in the license copyright notice but do not state a headquarters or founding date.Read 7 Oct 2026 · opalrb.com
- Rails usage
- The official homepage shows using opal-rails in a Rails app and requiring opal_ujs and turbolinks in its example.Read 7 Oct 2026 · opalrb.com
- Ruby compatibility
- The repository says the gemspec declares Ruby >= 2.3 and CI exercises Ruby 3.0 through 4.0 and JRuby.Read 7 Oct 2026 · github.com
- Ruby installation
- The project instructs users to install Opal with `gem install opal` or add the gem to a Gemfile.Read 7 Oct 2026 · github.com
- Runtime requirement
- Opal 2.0 targets ES2021 and has no transpilation fallback for older JavaScript engines.Read 7 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Compiles Ruby ahead of time without a runtime interpreter.
- Supports calls between Ruby and JavaScript.
- Lists browser and server-side JavaScript targets.
- Integrations include Rails, Sinatra, and Roda.
- Free and MIT-licensed.
Limits
- Upcoming 2.0 targets ES2021.
- No transpilation fallback for older JavaScript engines.
- Internet Explorer is unsupported for the listed 2.0 browser support.
Who it suits
Opal suits Ruby developers who want to compile Ruby to JavaScript and use Ruby and JavaScript together. Teams targeting older JavaScript engines should account for the stated ES2021 requirement and lack of fallback transpilation in 2.0.
Verdict
Opal specifies its compilation model, interoperability, environments, and framework integrations. Its upcoming 2.0 JavaScript target and browser support boundaries are important for projects with older engine requirements.
Where Specifiction places it
- Code Transpilers#18 of 287.7