$30 off During Our Annual Pro Sale. View Details »

Ruby; Exported

Ruby; Exported

Sapporo RubyKaigi 2012

Tatsuhiko Miyagawa

September 15, 2012
Tweet

More Decks by Tatsuhiko Miyagawa

Other Decks in Technology

Transcript

  1. Ruby; Exported
    Tatsuhiko Miyagawa
    Sapporo RubyKaigi 2012
    Sunday, September 30, 12

    View Slide

  2. About Me
    • Tatsuhiko Miyagawa
    • @miyagawa
    • San Francisco, CA
    • COOKPAD Inc. US
    Sunday, September 30, 12

    View Slide

  3. Sunday, September 30, 12

    View Slide

  4. Sunday, September 30, 12

    View Slide

  5. Sunday, September 30, 12

    View Slide

  6. Sunday, September 30, 12

    View Slide

  7. http://www.flickr.com/photos/ya-ko/5086710287/in/set-72157625177557742
    Sunday, September 30, 12

    View Slide

  8. Sunday, September 30, 12

    View Slide

  9. Sunday, September 30, 12

    View Slide

  10. Sunday, September 30, 12

    View Slide

  11. Sunday, September 30, 12

    View Slide

  12. Sunday, September 30, 12

    View Slide

  13. Sunday, September 30, 12

    View Slide

  14. Sunday, September 30, 12

    View Slide

  15. Cross Language
    Pollination
    Sunday, September 30, 12

    View Slide

  16. Perl's influence in Ruby
    Sunday, September 30, 12

    View Slide

  17. Sunday, September 30, 12

    View Slide

  18. Sunday, September 30, 12

    View Slide

  19. Ruby
    Heritage from Perl
    Sunday, September 30, 12

    View Slide

  20. http://edward.oconnor.cx/2006/03/ruby-is-perl-done-right
    Sunday, September 30, 12

    View Slide

  21. http://edward.oconnor.cx/2006/03/ruby-is-perl-done-right
    Sunday, September 30, 12

    View Slide

  22. ARGF
    Sunday, September 30, 12

    View Slide

  23. Sunday, September 30, 12

    View Slide

  24. Sunday, September 30, 12

    View Slide

  25. %q %Q
    Sunday, September 30, 12

    View Slide

  26. Sunday, September 30, 12

    View Slide

  27. Sunday, September 30, 12

    View Slide

  28. Sunday, September 30, 12

    View Slide

  29. ``
    Sunday, September 30, 12

    View Slide

  30. >  `date`  
    #  =>  "Sat  Sep  15  09:20:07  JST  2012\n"
    >  %x{echo  oops  &&  exit  99}
    #  =>  "echo\n"
    >  $?.exitstatus
    #  =>  99
    Sunday, September 30, 12

    View Slide

  31. $!  $@  $;  $,  $/  $\
    $.  $_  $>  $<  $$  $?
    $~  $=  $*  $&  $`  $'
    Sunday, September 30, 12

    View Slide

  32. Sunday, September 30, 12

    View Slide

  33. Sunday, September 30, 12

    View Slide

  34. Sunday, September 30, 12

    View Slide

  35. Mostly, things you
    don't like :p
    Sunday, September 30, 12

    View Slide

  36. "Perl's special variables are one of the
    biggest mistake I made in Ruby."
    Sunday, September 30, 12

    View Slide

  37. http://blog.nicksieger.com/articles/2007/10/06/obscure-and-ugly-perlisms-in-ruby
    Sunday, September 30, 12

    View Slide

  38. Gems
    Sunday, September 30, 12

    View Slide

  39. Sunday, September 30, 12

    View Slide

  40. Sunday, September 30, 12

    View Slide

  41. Sunday, September 30, 12

    View Slide

  42. Sunday, September 30, 12

    View Slide

  43. Ruby's influences
    in other languages
    (Perl)
    Sunday, September 30, 12

    View Slide

  44. Sunday, September 30, 12

    View Slide

  45. Full-stack
    Web frameworks
    Sunday, September 30, 12

    View Slide

  46. Sunday, September 30, 12

    View Slide

  47. Sunday, September 30, 12

    View Slide

  48. micro web frameworks
    Sunday, September 30, 12

    View Slide

  49. Sunday, September 30, 12

    View Slide

  50. Sunday, September 30, 12

    View Slide

  51. DSL
    Sunday, September 30, 12

    View Slide

  52. Sunday, September 30, 12

    View Slide

  53. Sunday, September 30, 12

    View Slide

  54. Perl Modules
    for Ruby
    Sunday, September 30, 12

    View Slide

  55. Sunday, September 30, 12

    View Slide

  56. Sunday, September 30, 12

    View Slide

  57. Sunday, September 30, 12

    View Slide

  58. Sunday, September 30, 12

    View Slide

  59. Sunday, September 30, 12

    View Slide

  60. Sunday, September 30, 12

    View Slide

  61. My Cases
    Sunday, September 30, 12

    View Slide

  62. Plack / PSGI
    Sunday, September 30, 12

    View Slide

  63. #  WSGI
    def  hello(environ,  start_response):
       start_response(“200  OK”,  [
           (‘Content-­‐Type’,  ‘text/plain’)
       ])
       return  [“Hello  World”]
    Sunday, September 30, 12

    View Slide

  64. #  Rack
    app  =  -­‐>(env)  {
       return  [  
           200,  
           {  'Content-­‐Type'  =>  'text/plain'  },    
           [  'Hello  World'  ]
       ]
    }
    Sunday, September 30, 12

    View Slide

  65. #  PSGI
    my  $app  =  sub  {
       my  $env  =  shift;
       return  [  
           200,
           [  'Content-­‐Type',  'text/plain'  ],
           [  'Hello  World'  ]
       ];
    };
    Sunday, September 30, 12

    View Slide

  66. Sunday, September 30, 12

    View Slide

  67. Sunday, September 30, 12

    View Slide

  68. Sunday, September 30, 12

    View Slide

  69. Sunday, September 30, 12

    View Slide

  70. It's been a huge success.
    Sunday, September 30, 12

    View Slide

  71. CGI::Application
    Apache IIS lighttpd
    CGI.pm
    CGI fastcgi
    mod_perl
    Jifty
    Mason Catalyst
    Mason::CGIHandler
    Catalyst::Engine
    nginx
    HTTP::Server
    ::Simple
    Sunday, September 30, 12

    View Slide

  72. PSGI
    Plack::Middleware
    Catalyst CGI::App Jifty Dancer
    Apache lighttpd HTTP::Server::PSGI Perlbal
    mod_psgi
    Plack::Handler::* (CGI, FCGI, Apache)
    Starman Twiggy uWSGI Corona Feersum
    Mojolicious
    Sunday, September 30, 12

    View Slide

  73. We chose Rack (over WSGI)
    to copy from:
    It's newer and simpler.
    Sunday, September 30, 12

    View Slide

  74. Sunday, September 30, 12

    View Slide

  75. Sunday, September 30, 12

    View Slide

  76. Plack
    Sunday, September 30, 12

    View Slide

  77. Inspired by:
    Rack, Werkzeug
    Sunday, September 30, 12

    View Slide

  78. Sunday, September 30, 12

    View Slide

  79. Sunday, September 30, 12

    View Slide

  80. WSGI: Dec 2003
    Rack: Aug 2009 (0.9)
    Sunday, September 30, 12

    View Slide

  81. “The nicest thing about being late is that
    there are plenty of things left to steal.”
    Sunday, September 30, 12

    View Slide

  82. Better late than never
    Sunday, September 30, 12

    View Slide

  83. Better late than too early :)
    Sunday, September 30, 12

    View Slide

  84. Cross-language
    Pollination
    Sunday, September 30, 12

    View Slide

  85. Sunday, September 30, 12

    View Slide

  86. Sunday, September 30, 12

    View Slide

  87. Sunday, September 30, 12

    View Slide

  88. http://bulknews.typepad.com/blog/2009/10/psgiplack-streaming-is-now-complete.html
    Sunday, September 30, 12

    View Slide

  89. Sunday, September 30, 12

    View Slide

  90. Sunday, September 30, 12

    View Slide

  91. rubygems
    Sunday, September 30, 12

    View Slide

  92. Sunday, September 30, 12

    View Slide

  93. Sunday, September 30, 12

    View Slide

  94. rubygems
    quiet and intuitive.
    Sunday, September 30, 12

    View Slide

  95. Sunday, September 30, 12

    View Slide

  96. Sunday, September 30, 12

    View Slide

  97. Sunday, September 30, 12

    View Slide

  98. Sunday, September 30, 12

    View Slide

  99. Carton
    Sunday, September 30, 12

    View Slide

  100. Sunday, September 30, 12

    View Slide

  101. Like Bundler
    Sunday, September 30, 12

    View Slide

  102. Sunday, September 30, 12

    View Slide

  103. Starman
    PSGI HTTP Server
    Sunday, September 30, 12

    View Slide

  104. http://tomayko.com/writings/unicorn-is-unix
    Sunday, September 30, 12

    View Slide

  105. Sunday, September 30, 12

    View Slide

  106. Sunday, September 30, 12

    View Slide

  107. Name
    Sunday, September 30, 12

    View Slide

  108. "Naming is Important."
    Sunday, September 30, 12

    View Slide

  109. Sunday, September 30, 12

    View Slide

  110. Sunday, September 30, 12

    View Slide

  111. Sunday, September 30, 12

    View Slide

  112. Sunday, September 30, 12

    View Slide

  113. Sunday, September 30, 12

    View Slide

  114. CPAN traditionally
    prefers long names
    Sunday, September 30, 12

    View Slide

  115. Sunday, September 30, 12

    View Slide

  116. Sunday, September 30, 12

    View Slide

  117. Sunday, September 30, 12

    View Slide

  118. Too many ::’s!
    Hard to type nor say. People tend to shorten the names.
    e.g. MXMARMR (MooseX::MetaAttribute::Role::Meta::Role)
    Sunday, September 30, 12

    View Slide

  119. Sunday, September 30, 12

    View Slide

  120. Perl
    • HTTP::Server::Simple
    • JSON::XS
    • Devel::StackTrace
    • Net::OAuth::Lite
    • Text::CSV_XS
    Sunday, September 30, 12

    View Slide

  121. Python
    • python-json
    • pyoauth2
    • pygeoip
    • PyYAML
    • Numpy
    Sunday, September 30, 12

    View Slide

  122. Ruby
    • Yajl
    • Psych
    • unicorn
    • thin
    • puma
    • doorkeeper
    • kaminari
    • paperclip
    • resque
    • pry
    • factory_girl
    • capybara
    Sunday, September 30, 12

    View Slide

  123. Perl
    Descriptive, boring, ::Simple
    Python
    Descriptive, confusing, py*, *.py
    Ruby
    Fancy, creative, chaotic
    Sunday, September 30, 12

    View Slide

  124. except Frameworks.
    Django, bottle, Catalyst, Dancer,
    Mojolicious, Rails, Sinatra
    Sunday, September 30, 12

    View Slide

  125. People tend to love
    software with names.
    (citation needed)
    Sunday, September 30, 12

    View Slide

  126. Starman Starlet Twiggy
    Markapl Corona Pinto
    Xslate Carton
    Confusing for a bit, but it feels more "real".
    Sunday, September 30, 12

    View Slide

  127. How it's received:
    Sunday, September 30, 12

    View Slide

  128. Telling Perl developers
    "Ruby is awesome"
    makes them defensive.
    Sunday, September 30, 12

    View Slide

  129. Shipping awesome code
    inspired by Ruby
    makes them appreciative
    Sunday, September 30, 12

    View Slide

  130. (We Code)
    Sunday, September 30, 12

    View Slide

  131. Sunday, September 30, 12

    View Slide

  132. Sunday, September 30, 12

    View Slide

  133. Sunday, September 30, 12

    View Slide

  134. Starman
    Starlet
    Twiggy
    Plack::Handler::FCGI
    mod_perl 2
    HTTP::Server::PSGI
    H::S::Simple::PSGI
    CGI
    Feersum
    uWSGI
    mod_perl 1.3
    0 15 30 45 60
    Sunday, September 30, 12

    View Slide

  135. http://www.bofh.org.uk/2010/03/10/falling-out-of-love-with-a-language
    Sunday, September 30, 12

    View Slide

  136. Sunday, September 30, 12

    View Slide

  137. Quite contrary!
    Sunday, September 30, 12

    View Slide

  138. Sunday, September 30, 12

    View Slide

  139. Sunday, September 30, 12

    View Slide

  140. Sunday, September 30, 12

    View Slide

  141. Sunday, September 30, 12

    View Slide

  142. Wrap up
    Sunday, September 30, 12

    View Slide

  143. Perl respects Ruby
    Sunday, September 30, 12

    View Slide

  144. http://www.artima.com/intv/ruby3.html
    Sunday, September 30, 12

    View Slide

  145. Sunday, September 30, 12

    View Slide

  146. Sunday, September 30, 12

    View Slide

  147. Sunday, September 30, 12

    View Slide

  148. http://yapcasia.org/2012/talk/show/bcdf8c9e-da9d-11e1-a79e-0d4e6aeab6a4
    Sunday, September 30, 12

    View Slide

  149. Thank you.
    Sunday, September 30, 12

    View Slide