Opal

What Opal is
Opal is a free, MIT-licensed Ruby-to-JavaScript source-to-source compiler. It compiles Ruby ahead of time into plain JavaScript without a runtime interpreter, and includes implementations of Ruby’s 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 also describes sharing the same gem, objects, and specs between server and client code. Opal can run in browsers and JavaScript environments including Node.js, Deno, Bun, and QuickJS. The project’s upcoming 2.0 release targets ES2021 and lists current and previous stable Firefox, Chrome, Safari, and Edge as supported; Internet Explorer is unsupported. There is no transpilation fallback for older JavaScript engines. Framework integrations include Rails, Sinatra, Roda, and static apps. The project shows installing with `gem install opal` or adding the gem to a Gemfile. Its repository says the gemspec declares Ruby >= 2.3 and CI exercises Ruby 3.0 through 4.0 and JRuby. Support is available through Slack, Stack Overflow’s #opalrb tag, and GitHub issues.
Who it suits
Opal suits Ruby developers who want to compile code to JavaScript and share code between server and client environments. Its ES2021 target and lack of fallback for older engines matter when choosing browser support.
What it does well
- Free under the MIT License.
- Compiles ahead of time without an interpreter.
- Supports Ruby and JavaScript interoperability.
- Integrations include Rails, Sinatra, and Roda.
- Runs in several JavaScript environments.
What to know first
- Internet Explorer is unsupported for the upcoming 2.0 release.
- No fallback exists for older JavaScript engines.
- The upcoming 2.0 release targets ES2021.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Opal | MIT-licensed software | Free |
As opalrb.com lists them, read 7 Oct 2026. The maker's own page has the final word.
Getting started
- Install Opal with `gem install opal` or add the gem to a Gemfile.
- Use the CLI or API to compile Ruby to JavaScript.
- Choose a listed target such as a browser, Node.js, Deno, Bun, or QuickJS.
- For Rails, use opal-rails; the homepage example also requires opal_ujs and turbolinks.
Verdict
Opal offers Ruby-to-JavaScript compilation with interoperability and framework integrations. Check the ES2021 requirement and browser support for the upcoming 2.0 release against the environments you need to support.
Questions
How much does Opal cost?
The listed plan is free, and Opal is MIT-licensed.
Is there a free plan or trial?
Opal has a free plan. There is no free trial.
Which platforms and runtimes does Opal support?
The listed platforms are Linux, macOS, web, and Windows. The project names browsers, Node.js, Deno, Bun, and QuickJS as execution targets.
Which browsers are supported?
For the upcoming 2.0 release, current and previous stable Firefox, Chrome, Safari, and Edge are listed. Internet Explorer is unsupported.
How do I install Opal?
Install it with `gem install opal` or add the gem to a Gemfile.
What license does Opal use?
Opal is released under the MIT License.
Facts from Opal's own pages
- 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. · github.com, 7 Oct 2026
- Code sharing
- The project describes using the same gem, objects, and specs on both the server and client. · github.com, 7 Oct 2026
- Compilation
- Opal compiles Ruby to plain JavaScript ahead of time, without a runtime interpreter. · github.com, 7 Oct 2026
- Execution targets
- The project says Opal can run in browsers and in JavaScript environments including Node.js, Deno, Bun, and QuickJS. · github.com, 7 Oct 2026
- Framework integrations
- The project lists integrations for Rails, Sinatra, Roda, and static apps. · github.com, 7 Oct 2026
- JavaScript interop
- Opal supports calling JavaScript from Ruby and Ruby from JavaScript, and treating native JavaScript classes as Ruby classes. · github.com, 7 Oct 2026
- License
- Opal is released under the MIT License. · opalrb.com, 7 Oct 2026
- Maker details
- The opened official pages identify Adam Beynon in the license copyright notice but do not state a headquarters or founding date. · opalrb.com, 7 Oct 2026
- Rails usage
- The official homepage shows using opal-rails in a Rails app and requiring opal_ujs and turbolinks in its example. · opalrb.com, 7 Oct 2026
- Ruby compatibility
- The repository says the gemspec declares Ruby >= 2.3 and CI exercises Ruby 3.0 through 4.0 and JRuby. · github.com, 7 Oct 2026
- Ruby installation
- The project instructs users to install Opal with `gem install opal` or add the gem to a Gemfile. · github.com, 7 Oct 2026
- Runtime requirement
- Opal 2.0 targets ES2021 and has no transpilation fallback for older JavaScript engines. · github.com, 7 Oct 2026
- Support
- The project directs users to Slack, Stack Overflow with the #opalrb tag, and GitHub issues for bugs and feature requests. · github.com, 7 Oct 2026
- What it does
- Opal is a Ruby-to-JavaScript source-to-source compiler that includes an implementation of Ruby corelib and stdlib. · github.com, 7 Oct 2026
Where Opal stands on Freedom251
- Code Transpilers#12 of 28