Reddirt2011

Post on 15-May-2015

1.164 views 0 download

Tags:

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 of Reddirt2011

TheJoyRubinius

of

TheAgonyRubySpec

of

∞more transitions

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”

caution(truth may be stretched)

attention

question

act

emotional

mental phys

ical

WhyRubinius

whyuserubinius.com

happy fun

happy funserious business™

happy funserious business™

when itʼs not fun anymore

proud to use Ruby

we use blocks

canʼt we all justget along?

feeling deep pleasureor satisfaction

Microsoft vs Apple

pragmatic

mental

physical emoti

onal

virtual machine

C-API

garbage collector

primitives

core library standard lib

your application

Architecture

JIT

core library standard lib

your application

Architecture

virtual machine

C-API

garbage collector

primitivesJIT

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

Virtual Machine

Bytecode Interpreter

Garbage Collector

ThreadsIO

Primitive Operations

Method Dispatch

Constant Lookup

String

Bytecode Compiler

AST SymbolicBytecode

CompiledMethod

CompiledFile

Parser Compiler

Source → Parser → Compiler

Source → Parser → Compiler → Virtu

script

class

name

Exclaimersuperclass

nilmethod

blurt

Abstract Syntax Tree

Source → Parser → Compiler → Virtual Machin

Large Object Space

Nursery

Young

Semi-Space

Mature

Immix

Generational GC

Immix:A Mark-Region Garbage Collector

with Space Efficiency, Fast Collection, and Mutator

Performance

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

just-in-time compiler

LLVM

Rubinius is

modern

sophisticated

high-performance

Ruby environment

physical

emotional mental

> time rbx -e ‘puts 1’0.3864s

> time ruby -e ‘puts 1’0.0196s

ZOMG20x slower

or0.3668s slower

x 1000 tests

0.32s vs 6m

:’(

</3

_script_

A

foo _block_

M

Bootstrapping

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

VM | OM

VM | OM

alpha.rb

VM | OM

alpha.rb

bootstrap/

VM | OM

alpha.rb

bootstrap/

platform/

VM | OM

alpha.rb

bootstrap/

platform/

common/

VM | OM

alpha.rb

bootstrap/

platform/

common/

delta/

VM | OM

alpha.rb

bootstrap/

platform/

common/

delta/

loader.rb

problem

opportunity

all good things come to those

who wait

be lazy

1. save as list

2. load script

3. resolve on call

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

kernel/bootstrap/array.rb

vm/builtin/array.hpp

kernel/bootstrap/array.rb

vm/builtin/array.hpp

vm/gen/primitives_glue.gen.hpp

LazyExecutable

kernel/bootstrap/lazy_executable.rb

vm/builtin/lazy_executable.hpp

vm/builtin/lazy_executable.cpp

detect

1. check method2. load if needed

encode

lib/compiler/compiled_file.rb

lib/compiler/compiled_file.rb

decode

vm/marshal.cpp

vm/marshal.cpp

vm/marshal.cpp

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

how to contribute

1. run your code

2. file issues

3. read docs

> rbx docs

4. file issues

5. write libraries

6. talk to people

7. send patches

no effort is too small

gh:evanphx/rubinius

http://rubini.us

TheAgonyRubySpec

of

array/index_spec.rb

array/index_spec.rb

integer/even_spec.rb

file/open_spec.rb

spec/compiler/and_spec.rb

3761 files16366 examples44765 expectations 0 failures 0 errors

99.5%

gh:rubyspec/rubyspec

http://rubyspec.org

Letʼs discuss...

Brian Ford brixen { rstat.us twitter IRC gmail }

|