Description
Opal is a Ruby to JavaScript source-to-source compiler. It takes Ruby code and turns it into JavaScript that runs in the browser, and it comes with the Ruby core library you already know. The site describes it as fast as a runtime and small in its footprint. You can load Opal from a CDN, or set it up in a Rack app, a Rails app or from the command line. For Rack, you add the opal, rack and rackup gems, configure a simple server in config.ru, and place a Ruby file in an app directory, which the browser runs. For Rails, a separate opal-rails gem integrates with the asset pipeline. The site's examples show a plain Ruby class that prints to the browser console, and a hello world that calls the browser's alert through the native module. The site links tutorials for Rack, Rails and the command-line interface, an Awesome Opal list of projects, and the documentation. Several users in the site's testimonials describe using Opal in production applications built with the Hyperstack framework. The current version listed is 1.8.2, and the source is on GitHub under the opal organization.…
Highlights
- Ruby to JavaScript source compiler
- Ruby core library in the browser
- Rack, Rails and command-line setup
- CDN-ready opal.min.js
- Awesome Opal project list
Ratings & Reviews
No ratings yet
Be the first to rate Opal.
People also visit
Ruby on Rails
Ruby on Rails is an open source full-stack web application framework
Opal FAQ
What is Opal?
A compiler that turns Ruby code into JavaScript, so Ruby can run in the browser.
Do I need to install anything?
You can use the CDN, or add the opal gem to a Rack or Rails app, as the getting started sections explain.
Does Opal work with Rails?
Yes. The site describes an opal-rails gem that integrates Opal with the Rails asset pipeline.
Which version is current?
Version 1.8.2, according to the site.
Where can I learn more?
The site links Rack, Rails and command-line tutorials, the documentation and an Awesome Opal list.
Is it free?
The listing shows it as free, and the source is on GitHub.
What are the best Opal alternatives?
Popular alternatives to Opal include Transcrypt, OpenWebContainer and Browserify. See all Opal alternatives
