Ruby to JavaScript compiler Opal allows developers to write Ruby code and compile it to JavaScript. Opal implements Ruby's core library and some standard library features to provide a Ruby-like experience. It compiles Ruby code to JavaScript using a source-to-source compiler, allowing the generated code to run natively in browsers. Opal provides good performance and compatibility with Ruby while avoiding the need for a new virtual machine. It enables options like writing Ruby code and interacting with existing JavaScript libraries and functions.
19. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
20. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
21. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
22. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
23. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
24. Ruby 2.2 includes many new features and improvements
for the increasingly diverse and expanding demands for
Ruby.
For example, Ruby’s Garbage Collector is now able to
collect Symbol type objects. This reduces memory
usage of Symbols; because GC was previously unable
to collect them before 2.2. Since Rails 5.0 will require
Symbol GC, it will support only Ruby 2.2 or later. (See
Rails 4.2 release post for details.)
Also, a reduced pause time thanks to the new
Incremental Garbage Collector will be helpful for running
Rails applications. Recent developments mentioned on
the Rails blog suggest that Rails 5.0 will take advantage
of Incremental GC as well as Symbol GC.
44. Ruby’s advantages
• Doesn’t have this
• Sane boolean semantics
• No need for a book called “Ruby: The Good Parts”
• No wtfruby.com
• Solid core library
• Extensive standard library
• Do you really need more?
47. • Initial release - 22.01.2010
• Used in production by 2013
• Popularity spikes in 2014 after the launch of
the Volt web framework
• Latest version (0.8.0) was released on
16.07.2015
94. Ruby compatibility
• Mostly compatible with Ruby 2.0
• Tested against RubySpec
• Implements most of the Ruby corelib
• Implements some of the stdlib (e.g. Set)
95. Notable differences
• true and false are translated to JavaScript’s booleans
• All numbers are JavaScript floats
• Strings are immutable
• Symbols are strings
• No dynamic requires
• No threads
• No frozen objects
• All methods are public
104. $document.ready do
alert 'yo folks, I'm all loaded up in here'
end
$document.body.style.apply {
background color: 'black'
color 'white'
font family: 'Verdana'
}
Browser::HTTP.get '/something.json' do
on :success do |res|
alert res.json.inspect
end
end