Upload
tranlien
View
229
Download
0
Embed Size (px)
Citation preview
Look at all these toys!
Help – it’s Ruby!
All alone
Is Ruby dying?
Where do Rubyists go?
Where do Rubyists go?Tobias Pfeiffer
@PragTobpragtob.info
673 Responses
First Rails Release
Rails 1.0
“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?
First Rails Girls Workshop
First Rails Girls Berlin Workshop
Surveys and Bias
Like some bias?
Like to do Ruby in 5 years?
Omissions
Tools
Disclaimer
Meet & Greet
1990 1995 2000 2005 2010 2015
Name:Popular Rubyists:Known for:
Self-assessment:
RubyAll of themMetaprogramming, dynamic,Scripting, webA dynamic, open source programming language with a focus on simplicity and productivity.
FizzBuzz!
12
12Fizz
12Fizz4Buzz
12Fizz4BuzzFizz
12Fizz4BuzzFizz78FizzBuzz11Fizz1314
12Fizz4BuzzFizz78FizzBuzz11Fizz1314FizzBuzz
12Fizz4BuzzFizz78FizzBuzz11Fizz1314FizzBuzz16…
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
Name:Popular Rubyists:
Known for:
Self-assessment:
CrystalErik Berlin, Piotr Szotkowski, Fabio Akita Ruby-like, Performance, Type Inference Fast as C, slick as Ruby
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
def fizzbuzz(n) if (n % 15).zero? "FizzBuzz" elsif (n % 5).zero? "Buzz" elsif (n % 3).zero? "Fizz" else n endend
(1..100).each {|n| puts fizzbuzz(n)}
cp fizzbuzz.rb fizzbuzz.cr
Name:Popular Rubyists:
Known for:
Self-assessment:
ElixirJosé Valim, Dave Thomas,Xavier NoriaErlang VM, Actors, Functional,Phoenixdynamic, functional language designed for building scalable and maintainable applications.
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: nend
Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)
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: nend
Enum.each(1..100, fn i -> IO.puts(FizzBuzz.fizzbuzz(i)) end)
Name:Popular Rubyists:Known for:Self-assessment:
HaskellChad FowlerType System, Monads, PureAn advanced, purely functional programming language.
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
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
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
Name:Popular Rubyists:Known for:
Self-assessment:
GoKatrina Owen, Evan PhoenixGoroutines, Simple, No Exceptions, No Genericsopen source programming language that makes it easy to build simple, reliable, and efficient software.
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))}
}
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))}
}
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))}
}
Name:Popular Rubyists:
Known for:
Self-assessment:
RustSteve Klabnik,Yehuda Katz, Sean GriffinMemory Management, Compiler, Firefox Quantuma systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
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(), }}
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(), }}
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(), }}
Name:Popular Rubyists:Known for:Self-assessment:
JavaScriptYehuda Katz, Jeremy AshkenasQuirks, Async, Compile to a lightweight interpreted or JIT-compiled programming language with first-class functions.
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));}
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));}
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));}
Name:Popular Rubyists:
Known for:Self-assessment:
ClojureRuss Olsen, BozhidarBatsov, Arne BrasseurRich 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.
(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)))
(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)))
(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)))
What you got?
Paradigm
Procedural ProceduralFunctional
FunctionalProcedural
Functional
Object Object Functional Functional
Parallelism
Parallelism vs Concurrency
YesGoroutines +
channelsYes
AgnosticYes/No
Webworkers+Yes
STM, pmap,Transducers
Concurrent Concurrent YesActors
YesMvar, par,
STM
Performance!
Type System
StaticInferred
StaticInferred
DynamicOptional
Inferred++
DynamicOptional
Inferred++
Dynamic StaticInferred++
DynamicOptional
Inferred++Static
Inferred++
Compiledvs
Interpreted
Compiled Compiled Interpreted Compiled
Interpreted Compiled Compiled Compiled
Self-hosted
Show me your code
Yes Yes No No
No Yes Yes Yes
Garbage-Collection
Yes No Yes Yes
Yes Yes Yes Yes
Single File Distribution
Yes Yes No No
No Yes Yes Yes
Ruby-likeSyntax
No No No No
Yes Yes Yes No
Parallel
Parallel
Typing
Parallel
Typing
Fast
So, what?
Expand Your Mind
“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?
Joy
Domain
Tools
Where doesRuby go?
“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.”
Where doesRuby go?
Parallel
Typing
Fast
“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.”
“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.”
We’re all great!
Explore some new lands!
Enjoy Coding & Learning in whatever language...
Tobias Pfeiffer@PragTob
pragtob.info