Ruby is said to be very popular in Japan and many companies use it, but is it true? Let's see what things are happening and how the situation looks like.
say = "I love Ruby" puts say # Output "I *LOVE* RUBY" say['love'] = "*love*" puts say.upcase # Output "I *love* Ruby" # five times 5.times { puts say } ruby-lang.org
You need an interpreter, you don’t have to understand how it works under the hood. Object-oriented yet functional, influenced by Perl and Smalltalk Everything is an object, even numbers and functions. No primitive types. Designed for programmer productivity and readability Care less about runtime performance, more about developer happiness. Highly dynamic: you can change almost everything at runtime It is called monkey patching: amend classes, redefine methods, reassign constants. Created by Yukihiro Matsumoto in 1995 So it was born in Japan! And still developed by mostly Japanese core team 🇯🇵
this in Threads, callbacks, and execution context in Ruby # Define a lambda y, l = 1, ->(x) { x + y } # Call it l.call(2) # => 3 # Use it for collection transformation [1, 2, 3].map(&l). # => [2, 3, 4] reduce(&:+) # => 9 Threads, callbacks… talk
Non-steep learning curve Readable and expressive Almost like English A lot of ready libraries “There is a gem for that” Nice and active community MINASWAN: Matz is nice and so we are nice Cons Slow runtime performance Not the best for CPU-bound tasks Poor parallelism due to GVL GVL: Global VM Lock restricts parallelism, but works well for I/O-bound tasks Memory footprint Debugging might be hard Monkey patching can make code hard to understand
Ruby 1995: Ruby 0.95 released 1996: Ruby 1.0 released 2002: First English book about Ruby published 2003: Ruby 1.8 released Ruby was mostly known in Japan and didn’t have much traction.
Ruby dynamic nature Convention over configuration Introspection and metaprogramming to reduce boilerplate No explicit requires for application code Everything is autoloaded, filenames are derived from class names Active Record ORM that maps database tables to Ruby objects and introspects database schema That all allowed really rapid development of web applications!
Probably was fully rewritten to another tech stack after a few years. GitHub Still uses Ruby on Rails, backports a lot of features to Rails itself. Shopify Runs on Ruby on Rails, manages to serve million RPS on Black Friday. Airbnb Started with Ruby on Rails, but now uses a lot of other technologies. Heroku Ruby on Rails was the first supported language on Heroku.
implementation written on C. TruffleRuby - A high performance implementation built on the GraalVM. JRuby - The Ruby Programming Language on the JVM Java libraries can be called directly, but C-extensions are not supported. mruby - lightweight partial implementation for embedded usage. Artichoke - Bundle Ruby applications into a single WASM binary, Ruby implementation in Rust. and more: https://github.com/codicoscepticos/ruby-implementations Ruby implementations
by Ruby itself inspired the community to create great tools, that inspired other communities. Bundler — dependency manager with lockfile Inspired Cargo, CocoaPods RSpec — testing framework Inspired Jest, Mocha RVM and Rbenv — Ruby version managers Inspired pyenv, nvm, asdf, and mise-en-place Capistrano — deployment tool for old server days Inspired many deploy tools like Ansistrano on top of Ansible
lightweight concurrency Fibers: cooperative multitasking Type definitions and checking with RBS Ruby 3x3: Ruby 3.0 is 3 times faster than Ruby 2.0 (thanks to JIT) Syntax changes: pattern matching, deconstructions, … …and many more changes: Ruby Evolution Rails 7 (2021) and 8 (2024): one-man-band framework for modern web development Hotwire: modern, HTML-over-the-wire approach Ruby Evolution
is in Japan Biggest Ruby conferences are in Japan RubyKaigi: 1500+ attendees in 2024 Kaigi on Rails: 700+ attendees in 2024 And a lot of regional Ruby conferences and meetups but Ruby is behind Python, Java, and Go Ranked 8th in popularity (21th worldwide by TIOBE) And isn’t highest paid one too With salaries ranked 9th from ¥4.1M per year 1. https://www.jetbrains.com/lp/devecosystem-2023/ruby/ ↩︎ 2. https://www.tokhimo.com/post/popular-programming-languages-in-japan-2022-1 ↩︎ [1] [2]
for embedded systems From keyboards (KeebKaigi) to satellites Popular for educational purposes Often taught in schools and universities. Also SmalRuby – visual Ruby programming for kids. Collaborations with government E.g. Ruby City MATSUE
the official site and in-browser Ruby Playground Programming Ruby aka “Pickaxe book” Agile Web Development with Rails Practical Object-Oriented Design Ruby Layered design for RoR applications Martian book with recipes for growing apps Ruby under a microscope for in-depth understanding of how Ruby works Attend meetups and conferences: RubyKaigi Kaigi on Rails And local ones too! Kyobashi.rb meetup Kansai RubyKaigi #08 conference Naniwa.rb meetup Ruby Tuesday meetup (usually online) … (that list isn’t exhaustive!)
@evilmartians.com evilmartians.com Our awesome blog: evilmartians.com/chronicles! These slides are here: envek.github.io/owddm-ruby-in-japan-vs-world Powered by Slides are here