reddirt2011

118
The Joy Rubinius of

Upload: brian-ford

Post on 15-May-2015

1.164 views

Category:

Technology


0 download

DESCRIPTION

Rubinius and RubySpec talk at the contributing to Open Source track at Red Dirt Ruby Conference 2011. These are the full slides. The talk used an abbreviated selection of these slides.

TRANSCRIPT

Page 1: Reddirt2011

TheJoyRubinius

of

Page 2: Reddirt2011

TheAgonyRubySpec

of

Page 4: Reddirt2011

∞more transitions

Page 5: Reddirt2011

http://dev-logger.blogspot.com/2009/01/reasons-behind-ruby-by-yukihiro-matz.html

“I lay awake at night dreaming about how to make developers happy”

Page 6: Reddirt2011

caution(truth may be stretched)

Page 7: Reddirt2011

attention

Page 8: Reddirt2011

question

Page 9: Reddirt2011

act

Page 10: Reddirt2011

emotional

mental phys

ical

Page 11: Reddirt2011

WhyRubinius

Page 12: Reddirt2011
Page 13: Reddirt2011

whyuserubinius.com

Page 14: Reddirt2011

happy fun

Page 15: Reddirt2011

happy funserious business™

Page 16: Reddirt2011

happy funserious business™

Page 17: Reddirt2011

when itʼs not fun anymore

Page 18: Reddirt2011

proud to use Ruby

Page 20: Reddirt2011

we use blocks

Page 21: Reddirt2011

canʼt we all justget along?

Page 22: Reddirt2011

feeling deep pleasureor satisfaction

Page 23: Reddirt2011

Microsoft vs Apple

Page 24: Reddirt2011

pragmatic

Page 25: Reddirt2011
Page 26: Reddirt2011

mental

physical emoti

onal

Page 27: Reddirt2011
Page 28: Reddirt2011

virtual machine

C-API

garbage collector

primitives

core library standard lib

your application

Architecture

JIT

Page 29: Reddirt2011

core library standard lib

your application

Architecture

virtual machine

C-API

garbage collector

primitivesJIT

Page 30: Reddirt2011

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Page 31: Reddirt2011

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Page 32: Reddirt2011

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Page 33: Reddirt2011

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Page 34: Reddirt2011
Page 35: Reddirt2011

String

Bytecode Compiler

AST SymbolicBytecode

CompiledMethod

CompiledFile

Parser Compiler

Page 36: Reddirt2011

Source → Parser → Compiler

Page 37: Reddirt2011

Source → Parser → Compiler → Virtu

script

class

name

Exclaimersuperclass

nilmethod

blurt

Abstract Syntax Tree

Page 38: Reddirt2011

Source → Parser → Compiler → Virtual Machin

Page 39: Reddirt2011
Page 40: Reddirt2011

Large Object Space

Nursery

Young

Semi-Space

Mature

Immix

Generational GC

Page 41: Reddirt2011

Immix:A Mark-Region Garbage Collector

with Space Efficiency, Fast Collection, and Mutator

Performance

Blackburn, S. & McKinley, K.(PLDI 2008)

Page 42: Reddirt2011

just-in-time compiler

Page 43: Reddirt2011

LLVM

Page 44: Reddirt2011
Page 45: Reddirt2011
Page 46: Reddirt2011
Page 47: Reddirt2011

Rubinius is

Page 48: Reddirt2011

modern

Page 49: Reddirt2011

sophisticated

Page 50: Reddirt2011

high-performance

Page 51: Reddirt2011

Ruby environment

Page 52: Reddirt2011

physical

emotional mental

Page 53: Reddirt2011

> time rbx -e ‘puts 1’0.3864s

> time ruby -e ‘puts 1’0.0196s

Page 54: Reddirt2011

ZOMG20x slower

Page 55: Reddirt2011

or0.3668s slower

Page 56: Reddirt2011

x 1000 tests

Page 57: Reddirt2011

0.32s vs 6m

Page 58: Reddirt2011

:’(

Page 59: Reddirt2011

</3

Page 60: Reddirt2011
Page 61: Reddirt2011

_script_

A

foo _block_

M

Page 62: Reddirt2011

Bootstrapping

http://www.myvintagesecret.com/page/7/

Page 63: Reddirt2011

VM | OM

Page 64: Reddirt2011

VM | OM

alpha.rb

Page 65: Reddirt2011

VM | OM

alpha.rb

bootstrap/

Page 66: Reddirt2011

VM | OM

alpha.rb

bootstrap/

platform/

Page 67: Reddirt2011

VM | OM

alpha.rb

bootstrap/

platform/

common/

Page 68: Reddirt2011

VM | OM

alpha.rb

bootstrap/

platform/

common/

delta/

Page 69: Reddirt2011

VM | OM

alpha.rb

bootstrap/

platform/

common/

delta/

loader.rb

Page 70: Reddirt2011

problem

Page 71: Reddirt2011

opportunity

Page 72: Reddirt2011

all good things come to those

who wait

Page 73: Reddirt2011

be lazy

Page 74: Reddirt2011

1. save as list

Page 75: Reddirt2011

2. load script

Page 76: Reddirt2011

3. resolve on call

Page 77: Reddirt2011

Ruby and C++ sittinʼ in a tree...

Page 78: Reddirt2011

kernel/bootstrap/array.rb

Page 79: Reddirt2011

vm/builtin/array.hpp

Page 80: Reddirt2011

kernel/bootstrap/array.rb

Page 81: Reddirt2011

vm/builtin/array.hpp

Page 82: Reddirt2011

vm/gen/primitives_glue.gen.hpp

Page 83: Reddirt2011

LazyExecutable

Page 84: Reddirt2011

kernel/bootstrap/lazy_executable.rb

Page 85: Reddirt2011

vm/builtin/lazy_executable.hpp

Page 86: Reddirt2011

vm/builtin/lazy_executable.cpp

Page 87: Reddirt2011

detect

Page 88: Reddirt2011

1. check method2. load if needed

Page 89: Reddirt2011

encode

Page 90: Reddirt2011

lib/compiler/compiled_file.rb

Page 91: Reddirt2011

lib/compiler/compiled_file.rb

Page 92: Reddirt2011

decode

Page 93: Reddirt2011

vm/marshal.cpp

Page 94: Reddirt2011

vm/marshal.cpp

Page 95: Reddirt2011

vm/marshal.cpp

Page 96: Reddirt2011

1. save as list2. load script3. resolve on call

Page 97: Reddirt2011

how to contribute

Page 98: Reddirt2011

1. run your code

Page 99: Reddirt2011

2. file issues

Page 100: Reddirt2011

3. read docs

Page 101: Reddirt2011

> rbx docs

Page 102: Reddirt2011

4. file issues

Page 103: Reddirt2011

5. write libraries

Page 104: Reddirt2011

6. talk to people

Page 105: Reddirt2011

7. send patches

Page 106: Reddirt2011

no effort is too small

Page 107: Reddirt2011

gh:evanphx/rubinius

http://rubini.us

Page 108: Reddirt2011

TheAgonyRubySpec

of

Page 109: Reddirt2011

array/index_spec.rb

Page 110: Reddirt2011

array/index_spec.rb

Page 111: Reddirt2011

integer/even_spec.rb

Page 112: Reddirt2011

file/open_spec.rb

Page 113: Reddirt2011

spec/compiler/and_spec.rb

Page 114: Reddirt2011

3761 files16366 examples44765 expectations 0 failures 0 errors

Page 115: Reddirt2011

99.5%

Page 116: Reddirt2011

gh:rubyspec/rubyspec

http://rubyspec.org

Page 117: Reddirt2011

Letʼs discuss...

Page 118: Reddirt2011

Brian Ford brixen { rstat.us twitter IRC gmail }

|