Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubyzino 44

Rubyzino 44

* A few Ruby 2.5 features
* Ruby 3x3

Petros Amiridis

December 19, 2017
Tweet

More Decks by Petros Amiridis

Other Decks in Programming

Transcript

  1. Today 19:10 | Rubyzino 19:20 | A closer look at

    Swift generics 19:40 | Break & socializing 20:00 | Migrating from Ruby on Rails to Serverless 21:00 | Halaruby
  2. [1].each do |n| begin # something which might raise an

    exception n / 0 rescue SomeExceptionClass => some_variable # code that deals with some exception else # code that runs only if *no* exception was raised ensure # ensure that this code always runs, no matter what # does not change the final value of the block end end
  3. [1].each do |n| n / 0 rescue SomeExceptionClass => some_variable

    # code that deals with some exception else # code that runs only if *no* exception was raised ensure # ensure that this code always runs, no matter what # does not change the final value of the block end
  4. Bundler gem is now bundled $ ruby -v ruby 2.5.0preview1

    (2017-10-10 trunk 60153) [x86_64-darwin16] $ bundler -v Bundler version 1.15.4
  5. binding.irb vs pry • require 'irb' is no longer needed

    in your code, in order to invoke binding.irb. • Show source around binding.irb is now shown on startup.
  6. # test.rb: def test binding.irb end test # Running the

    file yields: From: test.rb @ line 2 : 1: def test => 2: binding.irb 3: end 4: test irb(main):001:0>
  7. Unicode 10.0 support • Ruby 2.5 has been updated to

    support the new characters • Bitcoin symbol • 56 new emojis
  8. Performance • Matz has announced that he wants Ruby 3

    to be three times as fast as Ruby 2.0.0 • Ruby 2.5.0 head-of-master speedup is around 165% of the speed of Ruby 2.0.0
  9. Concurrency Goals: • Retain compatibility with Ruby 2 • Allow

    for parallelism • Reconsider global locks that prevent parallel execution • ... and more Learn more: Concurrency in Ruby 3 with Guilds
  10. Typing • "still figuring out the spec" on Ruby 3

    changes to the type system. • Some on-paper proposals and some early implementations, but nothing is currently close to getting included as a standard part of the language.