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

A Brief History of Ruby

A Brief History of Ruby

An Exploration of How Ruby's Interpreter
Has Changed over the Years

Avatar for Danielle Smith

Danielle Smith

November 12, 2019
Tweet

More Decks by Danielle Smith

Other Decks in Programming

Transcript

  1. A Brief History of Ruby An Exploration of How Ruby's

    Interpreter Has Changed over the Years Ruby The Object-Oriented Scripting Language
  2. Ruby was “Born” February 24, 1993 0.95 2.7 2.6 2.2

    2.1 2.0 1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  3. Yukihiro “Matz” Matsumoto 0.95 2.7 2.6 2.2 2.1 2.0 1.0

    1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  4. MRI (Matz’ Ruby Interpreter) 0.95 2.7 2.6 2.2 2.1 2.0

    1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  5. 0.95 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9

    1995 2019 2018 2015 2014 2013 1996 2003 2007
  6. Object Oriented 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8

    1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  7. Mark-and-Sweep Garbage Collection 0.95 2.7 2.6 2.2 2.1 2.0 1.0

    1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  8. Parses source into Abstract Syntax Tree (AST) 0.95 2.7 2.6

    2.2 2.1 2.0 1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  9. Bison (derivative of YACC) 0.95 2.7 2.6 2.2 2.1 2.0

    1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  10. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 def foo(a, b) a + b end Source
  11. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 def foo(a, b) a + b end Source
  12. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 def foo(a, b) a + b end Tokens
  13. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 AST DEFN ARGS BLOCK OPCALL LVAR [:a, :b] :+ :a :foo LVAR :b def foo(a, b) a + b end
  14. “Runs” the AST 0.95 2.7 2.6 2.2 2.1 2.0 1.0

    1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  15. rb_eval in eval.c 0.95 2.7 2.6 2.2 2.1 2.0 1.0

    1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  16. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007
  17. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 1.0
  18. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 Christmas 1996
  19. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 1.8
  20. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 1.9
  21. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 “Lazy Sweep” Garbage Collection
  22. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 Introduced YARV “Yet Another Ruby VM”
  23. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 Compiles AST to VARV Instruction Sequences (ISEQ)
  24. AST DEFN ARGS BLOCK OPCALL LVAR [:a, :b] :+ :a

    :foo LVAR :b def foo(a, b) a + b end 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  25. YARV ISEQ DEFN ARGS BLOCK OPCALL LVAR [:a, :b] :+

    :a :foo LVAR :b == ISeq:<main> putobject :foo putiseq foo opt_send :define_method, argc: 2 leave == ISeq:foo local table (size: 2, argc: 2) [ 2] a@0<Arg> [ 1] b@1<Arg> getlocal a@0 getlocal b@1 opt_plus :+, argc: 1 leave 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995 2019 2018 2015 2014 2013 1996 2003 2007
  26. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 iseq_compile_each in compile.c
  27. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007
  28. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 2.0
  29. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 “Bitmap Marking” Garbage Collection
  30. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 2.1
  31. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 “Generational” Garbage Collection
  32. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 2.2
  33. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 “Incremental” Garbage Collection
  34. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 2.6
  35. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 MJIT
  36. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 Generates C code from ISEQ
  37. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007
  38. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 2.7
  39. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 “Compacting” Garbage Collection
  40. 0.95 2.7 2.6 2.2 2.1 2.0 1.0 1.8 1.9 1995

    2019 2018 2015 2014 2013 1996 2003 2007 3.0?
  41. Pat Shaughnessy Ruby Under a Microscope Matias Korhonen Ruby Like

    it’s 1995 Nate Bekropen A People’s History of the Ruby Garbage Collector References