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

Where do Rubyists go?

Where do Rubyists go?

Many Rubyists branch out and take a look at other languages. What are similarities between those languages and ruby? What are differences? How does Ruby influence these languages?

Tobias Pfeiffer

January 26, 2018
Tweet

More Decks by Tobias Pfeiffer

Other Decks in Programming

Transcript

  1. Look at all these toys!

    View Slide

  2. Help – it’s Ruby!

    View Slide

  3. All alone

    View Slide

  4. Is Ruby dying?

    View Slide

  5. Where do Rubyists go?

    View Slide

  6. Where do Rubyists go?
    Tobias Pfeiffer
    @PragTob
    pragtob.info

    View Slide

  7. View Slide

  8. 673 Responses

    View Slide

  9. View Slide

  10. View Slide

  11. First Rails Release

    View Slide

  12. Rails 1.0

    View Slide

  13. “I had written half of Rails in
    PHP. Then Rails was announced
    and it was like a cheat code to
    a working framework.”
    Why did you learn Ruby?

    View Slide

  14. First Rails Girls Workshop

    View Slide

  15. First Rails Girls Berlin Workshop

    View Slide

  16. Surveys and Bias

    View Slide

  17. Like some bias?

    View Slide

  18. Like to do Ruby in 5 years?

    View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. Omissions

    View Slide

  23. Tools

    View Slide

  24. Disclaimer

    View Slide

  25. Meet & Greet

    View Slide

  26. 1990 1995 2000 2005 2010 2015

    View Slide

  27. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Ruby
    All of them
    Metaprogramming, dynamic,
    Scripting, web
    A dynamic, open source
    programming language with a
    focus on simplicity and
    productivity.

    View Slide

  28. FizzBuzz!

    View Slide

  29. 1
    2

    View Slide

  30. 1
    2
    Fizz

    View Slide

  31. 1
    2
    Fizz
    4
    Buzz

    View Slide

  32. 1
    2
    Fizz
    4
    Buzz
    Fizz

    View Slide

  33. 1
    2
    Fizz
    4
    Buzz
    Fizz
    7
    8
    Fizz
    Buzz
    11
    Fizz
    13
    14

    View Slide

  34. 1
    2
    Fizz
    4
    Buzz
    Fizz
    7
    8
    Fizz
    Buzz
    11
    Fizz
    13
    14
    FizzBuzz

    View Slide

  35. 1
    2
    Fizz
    4
    Buzz
    Fizz
    7
    8
    Fizz
    Buzz
    11
    Fizz
    13
    14
    FizzBuzz
    16

    View Slide

  36. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  37. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  38. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  39. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  40. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  41. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  42. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  43. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Crystal
    Erik Berlin, Piotr Szotkowski,
    Fabio Akita
    Ruby-like, Performance, Type
    Inference
    Fast as C, slick as Ruby

    View Slide

  44. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}

    View Slide

  45. def fizzbuzz(n)
    if (n % 15).zero?
    "FizzBuzz"
    elsif (n % 5).zero?
    "Buzz"
    elsif (n % 3).zero?
    "Fizz"
    else
    n
    end
    end
    (1..100).each {|n| puts fizzbuzz(n)}
    cp fizzbuzz.rb fizzbuzz.cr

    View Slide

  46. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Elixir
    José Valim, Dave Thomas,
    Xavier Noria
    Erlang VM, Actors, Functional,
    Phoenix
    dynamic, functional language
    designed for building scalable
    and maintainable applications.

    View Slide

  47. defmodule FizzBuzz do
    def fizzbuzz(n) when rem(n, 15) == 0, do: "FizzBuzz"
    def fizzbuzz(n) when rem(n, 5) == 0, do: "Buzz"
    def fizzbuzz(n) when rem(n, 3) == 0, do: "Fizz"
    def fizzbuzz(n), do: n
    end
    Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)

    View Slide

  48. defmodule FizzBuzz do
    def fizzbuzz(n) when rem(n, 15) == 0, do: "FizzBuzz"
    def fizzbuzz(n) when rem(n, 5) == 0, do: "Buzz"
    def fizzbuzz(n) when rem(n, 3) == 0, do: "Fizz"
    def fizzbuzz(n), do: n
    end
    Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)

    View Slide

  49. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Haskell
    Chad Fowler
    Type System, Monads, Pure
    An advanced, purely functional
    programming language.

    View Slide

  50. main = mapM_ (putStrLn . fizzbuzz) [1..100]
    fizzbuzz x
    | x `mod` 15 == 0 = "FizzBuzz"
    | x `mod` 3 == 0 = "Fizz"
    | x `mod` 5 == 0 = "Buzz"
    | otherwise = show x

    View Slide

  51. main = mapM_ (putStrLn . fizzbuzz) [1..100]
    fizzbuzz x
    | x `mod` 15 == 0 = "FizzBuzz"
    | x `mod` 3 == 0 = "Fizz"
    | x `mod` 5 == 0 = "Buzz"
    | otherwise = show x

    View Slide

  52. main = mapM_ (putStrLn . fizzbuzz) [1..100]
    fizzbuzz x
    | x `mod` 15 == 0 = "FizzBuzz"
    | x `mod` 3 == 0 = "Fizz"
    | x `mod` 5 == 0 = "Buzz"
    | otherwise = show x

    View Slide

  53. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Go
    Katrina Owen, Evan Phoenix
    Goroutines, Simple, No
    Exceptions, No Generics
    open source programming
    language that makes it easy to
    build simple, reliable, and
    efficient software.

    View Slide

  54. package main
    import "fmt"
    import "strconv"
    func FizzBuzz(i int) string {
    switch {
    case i%15 == 0:
    return "FizzBuzz"
    case i%3 == 0:
    return "Fizz"
    case i%5 == 0:
    return "Buzz"
    default:
    return strconv.Itoa(i)
    }
    }
    func main() {
    for i := 1; i <= 100; i++ {
    fmt.Println(FizzBuzz(i))
    }
    }

    View Slide

  55. package main
    import "fmt"
    import "strconv"
    func FizzBuzz(i int) string {
    switch {
    case i%15 == 0:
    return "FizzBuzz"
    case i%3 == 0:
    return "Fizz"
    case i%5 == 0:
    return "Buzz"
    default:
    return strconv.Itoa(i)
    }
    }
    func main() {
    for i := 1; i <= 100; i++ {
    fmt.Println(FizzBuzz(i))
    }
    }

    View Slide

  56. package main
    import "fmt"
    import "strconv"
    func FizzBuzz(i int) string {
    switch {
    case i%15 == 0:
    return "FizzBuzz"
    case i%3 == 0:
    return "Fizz"
    case i%5 == 0:
    return "Buzz"
    default:
    return strconv.Itoa(i)
    }
    }
    func main() {
    for i := 1; i <= 100; i++ {
    fmt.Println(FizzBuzz(i))
    }
    }

    View Slide

  57. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Rust
    Steve Klabnik,
    Yehuda Katz, Sean Griffin
    Memory Management,
    Compiler, Firefox Quantum
    a systems programming
    language that runs blazingly
    fast, prevents segfaults, and
    guarantees thread safety.

    View Slide

  58. fn main() {
    (1..101).for_each(|n| println!("{}", fizzbuzz(n)))
    }
    fn fizzbuzz(n: i32) -> String {
    match (n % 3, n % 5) {
    (0, 0) => "FizzBuzz".to_string(),
    (0, _) => "Fizz".to_string(),
    (_, 0) => "Buzz".to_string(),
    _ => n.to_string(),
    }
    }

    View Slide

  59. fn main() {
    (1..101).for_each(|n| println!("{}", fizzbuzz(n)))
    }
    fn fizzbuzz(n: i32) -> String {
    match (n % 3, n % 5) {
    (0, 0) => "FizzBuzz".to_string(),
    (0, _) => "Fizz".to_string(),
    (_, 0) => "Buzz".to_string(),
    _ => n.to_string(),
    }
    }

    View Slide

  60. fn main() {
    (1..101).for_each(|n| println!("{}", fizzbuzz(n)))
    }
    fn fizzbuzz(n: i32) -> String {
    match (n % 3, n % 5) {
    (0, 0) => "FizzBuzz".to_string(),
    (0, _) => "Fizz".to_string(),
    (_, 0) => "Buzz".to_string(),
    _ => n.to_string(),
    }
    }

    View Slide

  61. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    JavaScript
    Yehuda Katz, Jeremy Ashkenas
    Quirks, Async, Compile to
    a lightweight interpreted or JIT-
    compiled programming
    language with first-class
    functions.

    View Slide

  62. const fizzBuzz = n => {
    if (n % 15 === 0) {
    return "FizzBuzz";
    } else if (n % 3 === 0) {
    return "Fizz";
    } else if (n % 5 === 0) {
    return "Buzz";
    } else {
    return n;
    }
    };
    for (let n = 1; n <= 100; n += 1) {
    console.log(fizzBuzz(n));
    }

    View Slide

  63. const fizzBuzz = n => {
    if (n % 15 === 0) {
    return "FizzBuzz";
    } else if (n % 3 === 0) {
    return "Fizz";
    } else if (n % 5 === 0) {
    return "Buzz";
    } else {
    return n;
    }
    };
    for (let n = 1; n <= 100; n += 1) {
    console.log(fizzBuzz(n));
    }

    View Slide

  64. const fizzBuzz = n => {
    if (n % 15 === 0) {
    return "FizzBuzz";
    } else if (n % 3 === 0) {
    return "Fizz";
    } else if (n % 5 === 0) {
    return "Buzz";
    } else {
    return n;
    }
    };
    for (let n = 1; n <= 100; n += 1) {
    console.log(fizzBuzz(n));
    }

    View Slide

  65. Name:
    Popular Rubyists:
    Known for:
    Self-assessment:
    Clojure
    Russ Olsen, Bozhidar
    Batsov, Arne Brasseur
    Rich Hickey, Lisp, JVM, ()
    a robust, practical, and fast
    programming language with a
    set of useful features that
    together form a simple,
    coherent, and powerful tool.

    View Slide

  66. (defn fizzbuzz [n]
    (cond
    (zero? (mod n 15)) "FizzBuzz"
    (zero? (mod n 3)) "Fizz"
    (zero? (mod n 5)) "Buzz"
    :else n))
    (run! println (map fizzbuzz (range 1 101)))

    View Slide

  67. (defn fizzbuzz [n]
    (cond
    (zero? (mod n 15)) "FizzBuzz"
    (zero? (mod n 3)) "Fizz"
    (zero? (mod n 5)) "Buzz"
    :else n))
    (run! println (map fizzbuzz (range 1 101)))

    View Slide

  68. (defn fizzbuzz [n]
    (cond
    (zero? (mod n 15)) "FizzBuzz"
    (zero? (mod n 3)) "Fizz"
    (zero? (mod n 5)) "Buzz"
    :else n))
    (run! println (map fizzbuzz (range 1 101)))

    View Slide

  69. What you got?

    View Slide

  70. Paradigm

    View Slide

  71. Procedural Procedural
    Functional
    Functional
    Procedural
    Functional
    Object Object Functional Functional

    View Slide

  72. Parallelism

    View Slide

  73. Parallelism vs Concurrency

    View Slide

  74. Yes
    Goroutines +
    channels
    Yes
    Agnostic
    Yes/No
    Webworkers+
    Yes
    STM, pmap,
    Transducers
    Concurrent Concurrent Yes
    Actors
    Yes
    Mvar, par,
    STM

    View Slide

  75. Performance!

    View Slide

  76. Type System

    View Slide

  77. Static
    Inferred
    Static
    Inferred
    Dynamic
    Optional
    Inferred++
    Dynamic
    Optional
    Inferred++
    Dynamic Static
    Inferred++
    Dynamic
    Optional
    Inferred++
    Static
    Inferred++

    View Slide

  78. Compiled
    vs
    Interpreted

    View Slide

  79. Compiled Compiled Interpreted Compiled
    Interpreted Compiled Compiled Compiled

    View Slide

  80. Self-hosted

    View Slide

  81. Show me your code

    View Slide

  82. Yes Yes No No
    No Yes Yes Yes

    View Slide

  83. Garbage-
    Collection

    View Slide

  84. Yes No Yes Yes
    Yes Yes Yes Yes

    View Slide

  85. Single File
    Distribution

    View Slide

  86. Yes Yes No No
    No Yes Yes Yes

    View Slide

  87. Ruby-like
    Syntax

    View Slide

  88. No No No No
    Yes Yes Yes No

    View Slide

  89. View Slide

  90. Parallel

    View Slide

  91. Parallel
    Typing

    View Slide

  92. Parallel
    Typing
    Fast

    View Slide

  93. So, what?

    View Slide

  94. Expand Your Mind

    View Slide

  95. “Ruby's OO model was
    brain-expanding, and I was
    seeking more brain-expanding
    paradigms that would let me
    think entirely new thoughts.”
    Why did you learn a new language?

    View Slide

  96. Joy

    View Slide

  97. Domain

    View Slide

  98. Tools

    View Slide

  99. Where does
    Ruby go?

    View Slide

  100. “Rails is strangling Ruby. In the
    same way that you don't quit
    because of a bad company, you
    quit because of a bad boss.”

    View Slide

  101. Where does
    Ruby go?

    View Slide

  102. Parallel
    Typing
    Fast

    View Slide

  103. “Ruby is the best language I
    have used over my 30 years
    programming. I hope Ruby 3
    puts an end to the Ruby is
    slow meme once and for all.”

    View Slide

  104. “I really like Ruby for what it is,
    and don't think 'adding a type
    system' or something is the best
    way to keep Ruby relevant. Don't
    morph Ruby in to something
    it's not.”

    View Slide

  105. We’re all great!

    View Slide

  106. Explore some new lands!

    View Slide

  107. Enjoy Coding & Learning in whatever
    language...
    Tobias Pfeiffer
    @PragTob
    pragtob.info

    View Slide