Slide 1

Slide 1 text

Ruby, where are you going? Rubyfuza 2013

Slide 2

Slide 2 text

This talk is not about Rack see http://goo.gl/fY5Cw instead

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Konstantin Haase Open Source Developer github.com/rkh @konstantinhaase

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Travis CI, Sinatra Rack, Rubinius, Tilt, ...

Slide 7

Slide 7 text

“Second to K&R, the most lagom technical book I’ve read.” Peter Cooper (Ruby Inside) Discount Code: AUTHD 50% off ebook ($6.50) 40% off print

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

tiobe.com

Slide 10

Slide 10 text

1995 - Yukihiro "Mad Matz" Matsumoto creates Ruby to avert some vaguely unspecified apocalypse that will leave Australia a desert run by mohawked warriors and Tina Turner. The language is later renamed Ruby on Rails by its real inventor, David Heinemeier Hansson.

Slide 11

Slide 11 text

·ͭ΋ͱΏ͖ͻΖ

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

It’s like Smalltalk. Except it’s not.

Slide 21

Slide 21 text

General Purpose

Slide 22

Slide 22 text

Fully Object Oriented

Slide 23

Slide 23 text

Dynamically Typed

Slide 24

Slide 24 text

Strongly Typed

Slide 25

Slide 25 text

Mature

Slide 26

Slide 26 text

Low Entry Barrier

Slide 27

Slide 27 text

Amazing Community

Slide 28

Slide 28 text

Konstantin Haase Open Source Developer github.com/rkh @konstantinhaase

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

A Language and its Implementation

Slide 36

Slide 36 text

Sometimes it’s hard to separate the two

Slide 37

Slide 37 text

The Language

Slide 38

Slide 38 text

Algol/Ada/ Eiffel like syntax

Slide 39

Slide 39 text

“As an Emacs addict, I needed a language mode, auto-indent was a must. So I tried to write experimental ruby-mode.el. Fighting with emacs lisp and regular expression, for almost whole week, I somehow succeeded to implement auto-indentation for a language with ‘end’ delimiters.” “How Emacs changed my Life” Yukihiro “Matz” Matsumoto

Slide 40

Slide 40 text

Smalltalk like object model message sending, late binding

Slide 41

Slide 41 text

Emacs Lips like internals C-API, tagged pointers, GC, etc

Slide 42

Slide 42 text

What’s new?

Slide 43

Slide 43 text

Refinements marked experimental

Slide 44

Slide 44 text

Module#prepend

Slide 45

Slide 45 text

Keyword Arguments

Slide 46

Slide 46 text

The Implementation

Slide 47

Slide 47 text

One Language, Many Implementations

Slide 48

Slide 48 text

RubyMotion topaz webruby

Slide 49

Slide 49 text

Reference Implementation Ruby 1.9, Ruby 2.0

Slide 50

Slide 50 text

Full Replacements JRuby, Rubinius

Slide 51

Slide 51 text

Niche MagLev, MacRuby, RubyMotion, mRuby

Slide 52

Slide 52 text

Dead or Not There Yet™ everything else

Slide 53

Slide 53 text

Stability Testing, Peer Review, Continuous Integration

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

Performance Virtual Machines, JIT compilation, AOT compilation, Inlining

Slide 56

Slide 56 text

Efficiency Memory Profiling, Copy On Write, Shallow Copies

Slide 57

Slide 57 text

Tooling Debugger, Heap Dumps, VisualVM, Remote Agents

Slide 58

Slide 58 text

Compatibility RubySpec, Ruby Implementers Meeting, ISO/IEC 30170

Slide 59

Slide 59 text

Special Features Embedding, Java/.Net/Smalltalk integration, Hackability, Built in Object DB, ...

Slide 60

Slide 60 text

Ruby Implementers Meeting

Slide 61

Slide 61 text

New Process Proposed Anyone can propose a feature, needs a champion from Ruby Implementers team, needs specification (RubySpec) and documentation, needs consensus

Slide 62

Slide 62 text

“I am not that positive about having rigid process. And I want to make sure as long as I live on this mortal state, you need my approval before adding something as official Ruby. I am not going to stop being the dictator, but I want you guys to participate in the process of improving the language.” Ruby Implementors Meeting, December 2012 Yukihiro “Matz” Matsumoto

Slide 63

Slide 63 text

Virtual Machines

Slide 64

Slide 64 text

Source Code Parser Parse Tree Interpreter Bytecode Compiler Bytecode Interpreter JIT Machine Code CPU VM

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

MRI

Slide 67

Slide 67 text

Rubinius

Slide 68

Slide 68 text

JRuby

Slide 69

Slide 69 text

MRI

Slide 70

Slide 70 text

Since 1.9 Virtual Machine

Slide 71

Slide 71 text

Internal C API = External C API

Slide 72

Slide 72 text

Global Lock

Slide 73

Slide 73 text

Conservative Garbage Collector can lead to segfaults and memory leaks :( but now with a bitmap! :)

Slide 74

Slide 74 text

2.0 is ABI compatible to 1.9.3

Slide 75

Slide 75 text

Tail Call Recursion

Slide 76

Slide 76 text

No Machine Code Generation :(

Slide 77

Slide 77 text

JRuby

Slide 78

Slide 78 text

invokedynamic teaching the JVM how to dispatch Ruby

Slide 79

Slide 79 text

C-API deprecated use FFI instead

Slide 80

Slide 80 text

No Global Lock

Slide 81

Slide 81 text

Ever improving Java integration

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

Precise GC

Slide 84

Slide 84 text

Rubinius

Slide 85

Slide 85 text

A Hacker’s Dream™

Slide 86

Slide 86 text

2.0 release soon

Slide 87

Slide 87 text

No Global Lock

Slide 88

Slide 88 text

Zero Overhead Remote Debugging

Slide 89

Slide 89 text

1.9 (and 2.0) compatibility

Slide 90

Slide 90 text

Windows support

Slide 91

Slide 91 text

Precise GC

Slide 92

Slide 92 text

MagLev

Slide 93

Slide 93 text

Gemstone Smalltalk VM

Slide 94

Slide 94 text

Object DB

Slide 95

Slide 95 text

Amazing Tooling

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

VM not Open Source

Slide 98

Slide 98 text

RubyMotion

Slide 99

Slide 99 text

MacRuby on iOS

Slide 100

Slide 100 text

Shares some code with MRI

Slide 101

Slide 101 text

Not Open Source

Slide 102

Slide 102 text

mRuby

Slide 103

Slide 103 text

Embeddable Ruby based on MRI

Slide 104

Slide 104 text

Developed by Matz

Slide 105

Slide 105 text

AOT Compilation

Slide 106

Slide 106 text

Can run in your browser

Slide 107

Slide 107 text

One More Thing...

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Source Code Parser Parse Tree Interpreter Bytecode Compiler Bytecode Interpreter JIT Machine Code CPU VM

Slide 112

Slide 112 text

PyPy is different

Slide 113

Slide 113 text

Generates a JIT/AOT from an interpreter

Slide 114

Slide 114 text

Partial Evaluation like lisp macros, but without macros

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

Evaluate Code with Placeholders

Slide 122

Slide 122 text

Once you reach primitives, compile Supported backends: C, CLI (aka .Net), JVM, x86 machine code

Slide 123

Slide 123 text

Partial Evaluation includes Dispatch like inlining

Slide 124

Slide 124 text

Leave Placeholders if Inference is Impossible

Slide 125

Slide 125 text

RPython all placeholders must be inferable can be fully compiled ahead of time

Slide 126

Slide 126 text

Compiled Python is faaaaaast

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

How does this matter for Ruby?

Slide 129

Slide 129 text

RuPyPy

Slide 130

Slide 130 text

RuPyPy released yesterday Topaz

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

Pluggable GC

Slide 133

Slide 133 text

Transparent Object Elimination saves memory, maybe even memory leaks

Slide 134

Slide 134 text

Large parts can be written in Ruby cp -r rubinius/lib topaz/lib

Slide 135

Slide 135 text

Kernel VM MRI JRuby Rubinius MagLev Topaz C C Java Java Ruby C++ Ruby Smalltalk & C Ruby/Python RPython

Slide 136

Slide 136 text

So, Ruby, where are you going?

Slide 137

Slide 137 text

Wherever we take it.

Slide 138

Slide 138 text

Thank you! @konstantinhaase github.com/rkh