Opal a new_hope

399
Opal - a new hope (for Ruby Programmers) Forrest Chang @fkchang2000 Sunday, November 10, 13

description

Rubyconf 2013 presentation on Opal - Ruby in the browser. A New Hope for Ruby Programmers. Actual presentation has a ton of sound and video. I'll post the confreaks link when it's available. Update 2: link with sound, then a link to the rest of the video - https://vimeo.com/82573680 Update 1: Confreaks link. http://confreaks.com/videos/2904-rubyconf2013-opal-a-new-hope-for-ruby-programmers - They had to mute the star wars music coz youtube would reject all the sound. I'll see what can be done about that

Transcript of Opal a new_hope

Page 1: Opal a new_hope

Opal - a new hope

(for Ruby Programmers)Forrest Chang@fkchang2000

Sunday, November 10, 13

Page 2: Opal a new_hope

THIS PRESENTATION HAS BEEN RATED

RUBYR UNDER 17 REQUIRES ACCOMPANYING PARENT OR ADULT GUARDIAN

STRONG CODER HAPPINESS, COOLNESS,JOY AND LANGUAGE

FOR OPTIMUM VIEWING EXPERIENCE, PLEASE WAIT UNTIL THE TEXT HITS THE MIDDLE OF THE SCREEN

BEFORE READING (YOU’LL KNOW WHAT THIS MEANS

Sunday, November 10, 13

Page 3: Opal a new_hope

Sunday, November 10, 13

Page 4: Opal a new_hope

http://www.westhighlandmuseum.org.uk/wp-content/uploads/2010/11/Show-of-hands.jpg

Sunday, November 10, 13

Page 5: Opal a new_hope

Who Works with the

?http://www.websailer.com/wp-content/uploads/2013/07/www_image.jpg

Sunday, November 10, 13

Page 7: Opal a new_hope

Who works with

?http://www.bigfunkychicken.com/pctz/sith.jpg

Sunday, November 10, 13

Page 8: Opal a new_hope

Who Likes ruby Better?

http://th08.deviantart.net/fs70/200H/f/2009/349/4/f/Screamy_and_Bee_love_Ruby__by_dark__romance.jpg

Sunday, November 10, 13

Page 9: Opal a new_hope

You

Are my targeT audience

Sunday, November 10, 13

Page 10: Opal a new_hope

everyone else is also welcome!

Sunday, November 10, 13

Page 11: Opal a new_hope

It is a time of Javascript Revolution

Sunday, November 10, 13

Page 12: Opal a new_hope

JS Everywhere!

Sunday, November 10, 13

Page 13: Opal a new_hope

JS Everywhere!

Desktops

Sunday, November 10, 13

Page 14: Opal a new_hope

JS Everywhere!

Desktops

Mobile

Sunday, November 10, 13

Page 15: Opal a new_hope

JS Everywhere!

Desktops

MobileBackend

Sunday, November 10, 13

Page 21: Opal a new_hope

libs/Frameworks

http://www.pulsarmedia.eu/data/media/26/Darth_Vader_3D_Wallpaper.jpg

Sunday, November 10, 13

Page 22: Opal a new_hope

libs/Frameworks

dom

http://www.pulsarmedia.eu/data/media/26/Darth_Vader_3D_Wallpaper.jpg

Sunday, November 10, 13

Page 23: Opal a new_hope

libs/Frameworks

dom

GUi

http://www.pulsarmedia.eu/data/media/26/Darth_Vader_3D_Wallpaper.jpg

Sunday, November 10, 13

Page 24: Opal a new_hope

libs/Frameworks

dom

GUi

MV****

http://www.pulsarmedia.eu/data/media/26/Darth_Vader_3D_Wallpaper.jpg

Sunday, November 10, 13

Page 25: Opal a new_hope

libs/Frameworks

dom

GUi

MV****

So Much more

http://www.pulsarmedia.eu/data/media/26/Darth_Vader_3D_Wallpaper.jpg

Sunday, November 10, 13

Page 26: Opal a new_hope

An exciting time

http://www.kiagarriques.com/wp-content/uploads/2013/02/excited.jpg

Sunday, November 10, 13

Page 27: Opal a new_hope

like it was for ruby in 2008

http://assets.en.oreilly.com/1/event/24/rails2009_home_photo1.jpg

Sunday, November 10, 13

Page 28: Opal a new_hope

problem

Sunday, November 10, 13

Page 29: Opal a new_hope

language is javascript

Sunday, November 10, 13

Page 30: Opal a new_hope

language is javascript

Sunday, November 10, 13

Page 31: Opal a new_hope

The language is javascript!

Sunday, November 10, 13

Page 32: Opal a new_hope

Sunday, November 10, 13

Page 33: Opal a new_hope

felt this way, you have?

“JAVASCRIPT IS THE PATH TO THE DARK SIDE. JAVASCRIPT LEADS TO ANGER. ANGER LEADS TO HATE. HATE LEADS TO SUFFERING.” - YODA, IF HE WERE A CODER

Sunday, November 10, 13

Page 34: Opal a new_hope

ruby == community of forward

thinking polyglots

Sunday, November 10, 13

Page 35: Opal a new_hope

can’t ignore the possibilities/opportunites

Sunday, November 10, 13

Page 36: Opal a new_hope

with all the momentum behind javascript

Sunday, November 10, 13

Page 37: Opal a new_hope

pressure TO ADOPT

Sunday, November 10, 13

Page 38: Opal a new_hope

feelS like this

Sunday, November 10, 13

Page 39: Opal a new_hope

feelS like this

Sunday, November 10, 13

Page 40: Opal a new_hope

no one wants to be destroyed

Sunday, November 10, 13

Page 41: Opal a new_hope

segue

Sunday, November 10, 13

Page 42: Opal a new_hope

matz on ruby

Sunday, November 10, 13

Page 43: Opal a new_hope

matz on ruby

"For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy."

Sunday, November 10, 13

Page 44: Opal a new_hope

The purpose of Ruby

To make you happy

Sunday, November 10, 13

Page 45: Opal a new_hope

The purpose of Ruby

To make you happy

Sunday, November 10, 13

Page 46: Opal a new_hope

The Ruby Way

Sunday, November 10, 13

Page 47: Opal a new_hope

Not this

Sunday, November 10, 13

Page 48: Opal a new_hope

ultimately

Sunday, November 10, 13

Page 49: Opal a new_hope

the pitch

Sunday, November 10, 13

Page 50: Opal a new_hope

opal will make you happy

Sunday, November 10, 13

Page 51: Opal a new_hope

premise

Sunday, November 10, 13

Page 52: Opal a new_hope

ruby makes me happy

Sunday, November 10, 13

Page 53: Opal a new_hope

you too

Sunday, November 10, 13

Page 54: Opal a new_hope

opal is ruby

Sunday, November 10, 13

Page 55: Opal a new_hope

opal makes me happy

Sunday, November 10, 13

Page 56: Opal a new_hope

javascript makes me happy?

not as much

Sunday, November 10, 13

Page 57: Opal a new_hope

javascript makes me happy?

not as much

Sunday, November 10, 13

Page 58: Opal a new_hope

My opal journey -JDD

j oyDrivenDevelopment

Sunday, November 10, 13

Page 59: Opal a new_hope

My opal journey -JDD

j oyDrivenDevelopment

Sunday, November 10, 13

Page 60: Opal a new_hope

I don’t need Opal

Sunday, November 10, 13

Page 61: Opal a new_hope

I don’t need Opal

• in my job

Sunday, November 10, 13

Page 62: Opal a new_hope

I don’t need Opal

• in my job

• in my life

Sunday, November 10, 13

Page 63: Opal a new_hope

too much fun

Sunday, November 10, 13

Page 64: Opal a new_hope

too much fun

• can’t put it down

Sunday, November 10, 13

Page 65: Opal a new_hope

too much fun

• can’t put it down

• like a good book

Sunday, November 10, 13

Page 66: Opal a new_hope

SHARE

Sunday, November 10, 13

Page 67: Opal a new_hope

What is opal?

Sunday, November 10, 13

Page 68: Opal a new_hope

What is opal?

• Ruby to js source to source compiler, similar to coffeescript

Sunday, November 10, 13

Page 69: Opal a new_hope

What is opal?

• Ruby to js source to source compiler, similar to coffeescript

• small runtime (supports method missing, operator overloading, etc)

Sunday, November 10, 13

Page 70: Opal a new_hope

What is opal?

• Ruby to js source to source compiler, similar to coffeescript

• small runtime (supports method missing, operator overloading, etc)

• Ruby in the browser

Sunday, November 10, 13

Page 71: Opal a new_hope

Ruby in the browser

Sunday, November 10, 13

Page 72: Opal a new_hope

class Opal < Ruby include Browser::Access include Javascript::Interaction

runs_in :browser runs_in :node

makes_you :happyend

As Code

Sunday, November 10, 13

Page 73: Opal a new_hope

Sunday, November 10, 13

Page 74: Opal a new_hope

Sunday, November 10, 13

Page 75: Opal a new_hope

Switch gears

Sunday, November 10, 13

Page 76: Opal a new_hope

PAL SHOO W-2

Reasons Opal will make you happy

Sunday, November 10, 13

Page 77: Opal a new_hope

Sunday, November 10, 13

Page 78: Opal a new_hope

Reasons Opal will make you happy

Sunday, November 10, 13

Page 79: Opal a new_hope

1. It's just Ruby, and a viable one

Reasons Opal will make you happy

Sunday, November 10, 13

Page 80: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

Reasons Opal will make you happy

Sunday, November 10, 13

Page 81: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

Reasons Opal will make you happy

Sunday, November 10, 13

Page 82: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

4. Frameworks, we don't need no stinking frameworks (but we have some)

Reasons Opal will make you happy

Sunday, November 10, 13

Page 83: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

4. Frameworks, we don't need no stinking frameworks (but we have some)

5. Tools you already know and love

Reasons Opal will make you happy

Sunday, November 10, 13

Page 84: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

4. Frameworks, we don't need no stinking frameworks (but we have some)

5. Tools you already know and love

6. Easy integration with Ruby web frameworks

Reasons Opal will make you happy

Sunday, November 10, 13

Page 85: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

4. Frameworks, we don't need no stinking frameworks (but we have some)

5. Tools you already know and love

6. Easy integration with Ruby web frameworks

7. Awesome In Browser tools

Reasons Opal will make you happy

Sunday, November 10, 13

Page 86: Opal a new_hope

1. It's just Ruby, and a viable one

2. Greenspun's 10th Rule, Opal Edition

3. Solves things the Ruby way, making the programmer happy

4. Frameworks, we don't need no stinking frameworks (but we have some)

5. Tools you already know and love

6. Easy integration with Ruby web frameworks

7. Awesome In Browser tools8. New possibilities

Reasons Opal will make you happy

Sunday, November 10, 13

Page 87: Opal a new_hope

1. It's just Ruby, and a viable one

Sunday, November 10, 13

Page 88: Opal a new_hope

1. It's just Ruby, and a viable one

• Question Number 1 - is opal a viable option?

Sunday, November 10, 13

Page 89: Opal a new_hope

1. It's just Ruby, and a viable one

• Question Number 1 - is opal a viable option?

• in production - 6 plus apps, 2 more coming soon

Sunday, November 10, 13

Page 90: Opal a new_hope

1. It's just Ruby, and a viable one

• Question Number 1 - is opal a viable option?

• in production - 6 plus apps, 2 more coming soon

• Biggest apps are the store and mobile sites for a High end fashion/luxury brand (client confidentiality agreement)

Sunday, November 10, 13

Page 91: Opal a new_hope

High End Fashion/Luxury Site

Sunday, November 10, 13

Page 92: Opal a new_hope

High End Fashion/Luxury Site

• globally

Sunday, November 10, 13

Page 93: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

Sunday, November 10, 13

Page 94: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

Sunday, November 10, 13

Page 95: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

Sunday, November 10, 13

Page 96: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

• store: ~2 million page views/month

Sunday, November 10, 13

Page 97: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

• store: ~2 million page views/month

• mobile: ~2 million page views/month

Sunday, November 10, 13

Page 98: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

• store: ~2 million page views/month

• mobile: ~2 million page views/month

• store is responsive, mobile works

Sunday, November 10, 13

Page 99: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

• store: ~2 million page views/month

• mobile: ~2 million page views/month

• store is responsive, mobile works

• opal is not too heavy mobile devices

Sunday, November 10, 13

Page 100: Opal a new_hope

High End Fashion/Luxury Site

• globally

• ~2 million unique visitors/month

• ~20 Million page views/month

• Parts that involve opal

• store: ~2 million page views/month

• mobile: ~2 million page views/month

• store is responsive, mobile works

• opal is not too heavy mobile devices

• opal battle tested for ie8+, chrome, safari, firefox

Sunday, November 10, 13

Page 101: Opal a new_hope

1. It's just Ruby, and a viable one

Sunday, November 10, 13

Page 102: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

Sunday, November 10, 13

Page 103: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

Sunday, November 10, 13

Page 104: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

Sunday, November 10, 13

Page 105: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

• runs asciidoc gem unmodified

Sunday, November 10, 13

Page 106: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

• runs asciidoc gem unmodified

• runs mspec gem unmodified,

Sunday, November 10, 13

Page 107: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

• runs asciidoc gem unmodified

• runs mspec gem unmodified,

• rspec with some modification, primarily due to mutable strings

Sunday, November 10, 13

Page 108: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

• runs asciidoc gem unmodified

• runs mspec gem unmodified,

• rspec with some modification, primarily due to mutable strings

• can compile itself

Sunday, November 10, 13

Page 109: Opal a new_hope

1. It's just Ruby, and a viable one

• Real Ruby1.9.3 - compliant (mostly)

• passes 2367 rubyspec examples - goal to pass all

• capable of running complex ruby

• runs asciidoc gem unmodified

• runs mspec gem unmodified,

• rspec with some modification, primarily due to mutable strings

• can compile itself

• much of stdlib in already in place

Sunday, November 10, 13

Page 110: Opal a new_hope

testimonials

Sunday, November 10, 13

Page 111: Opal a new_hope

Sunday, November 10, 13

Page 112: Opal a new_hope

Sunday, November 10, 13

Page 113: Opal a new_hope

Sunday, November 10, 13

Page 114: Opal a new_hope

“That guy”

Sunday, November 10, 13

Page 115: Opal a new_hope

“That guy”what does dhh

think?

Sunday, November 10, 13

Page 116: Opal a new_hope

TextDHH On Opal

Sunday, November 10, 13

Page 117: Opal a new_hope

TextDHH On Opal

Sunday, November 10, 13

Page 118: Opal a new_hope

TextDHH On Opal

Sunday, November 10, 13

Page 119: Opal a new_hope

**

Sunday, November 10, 13

Page 120: Opal a new_hope

Ruby language features in OPal

Sunday, November 10, 13

Page 121: Opal a new_hope

Ruby language features in OPal

• classes

• modules &and mixins

• singleton methods

• method-missing

• arity checks

• lambda

• blocks

• yield

• constants

• global variables

• class variables

• instance variables

Sunday, November 10, 13

Page 122: Opal a new_hope

More Ruby language features in OPal

• Basic object

• Kernel

• Nilclass

• range

• hash

• string interpolation

• heredocs

• %%w splits

Sunday, November 10, 13

Page 123: Opal a new_hope

don’t underestimate the power of a a better language

Sunday, November 10, 13

Page 124: Opal a new_hope

don’t underestimate the power of a a better language

• those who chose ruby for the backend know what i mean

Sunday, November 10, 13

Page 125: Opal a new_hope

don’t underestimate the power of a a better language

• those who chose ruby for the backend know what i mean

• opal-irb, opal-inspector easy to write, easy to read, little code *****

Sunday, November 10, 13

Page 126: Opal a new_hope

don’t underestimate the power of a a better language

• those who chose ruby for the backend know what i mean

• opal-irb, opal-inspector easy to write, easy to read, little code *****

• leads us to ...

Sunday, November 10, 13

Page 127: Opal a new_hope

2. Greenspun's 10th Rule, Opal Edition

Greenspun’s Rule

Sunday, November 10, 13

Page 128: Opal a new_hope

2. Greenspun's 10th Rule, Opal Edition

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden,

slow implementation of half of Common Lisp.

Greenspun’s Rule

Sunday, November 10, 13

Page 129: Opal a new_hope

2. Greenspun's 10th Rule, Opal Edition

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden,

slow implementation of half of Common Lisp.

Greenspun’s Rule

Sunday, November 10, 13

Page 130: Opal a new_hope

2. Greenspun's 10th Rule, Opal Edition

Greenspun’s Rule, Opal Edition

Sunday, November 10, 13

Page 131: Opal a new_hope

2. Greenspun's 10th Rule, Opal Edition

Any sufficiently complicated Javascript program contains an ad hoc, informally-specified, bug-ridden,

slow implementation of half of Ruby

Greenspun’s Rule, Opal Edition

Sunday, November 10, 13

Page 132: Opal a new_hope

greenspun in action

Sunday, November 10, 13

Page 133: Opal a new_hope

greenspun in action

Some attempts inspired by, trying to imitate ruby or emulating

ruby like features in JS

Sunday, November 10, 13

Page 134: Opal a new_hope

prototype

Sunday, November 10, 13

Page 135: Opal a new_hope

prototype

Sunday, November 10, 13

Page 136: Opal a new_hope

underscore

Sunday, November 10, 13

Page 137: Opal a new_hope

underscore

Sunday, November 10, 13

Page 138: Opal a new_hope

http://rubyjs.org

Sunday, November 10, 13

Page 139: Opal a new_hope

http://rubyjs.org

Sunday, November 10, 13

Page 140: Opal a new_hope

strukt

Sunday, November 10, 13

Page 141: Opal a new_hope

strukt

Sunday, November 10, 13

Page 142: Opal a new_hope

string.js

Sunday, November 10, 13

Page 147: Opal a new_hope

JavaScriptMVC

Sunday, November 10, 13

Page 148: Opal a new_hope

JavaScriptMVC

Sunday, November 10, 13

Page 149: Opal a new_hope

def.js

Sunday, November 10, 13

Page 150: Opal a new_hope

def.js

Sunday, November 10, 13

Page 151: Opal a new_hope

Sunday, November 10, 13

Page 152: Opal a new_hope

Sunday, November 10, 13

Page 153: Opal a new_hope

Raiya in Humax

Sunday, November 10, 13

Page 154: Opal a new_hope

Raiya in Humax

Sunday, November 10, 13

Page 155: Opal a new_hope

http://scatterpoll.com/#title-slide

Sunday, November 10, 13

Page 156: Opal a new_hope

http://scatterpoll.com/#title-slide

Sunday, November 10, 13

Page 157: Opal a new_hope

ActiveJS

Sunday, November 10, 13

Page 158: Opal a new_hope

ActiveJS

Sunday, November 10, 13

Page 159: Opal a new_hope

RedScript

Sunday, November 10, 13

Page 160: Opal a new_hope

RedScript

Sunday, November 10, 13

Page 161: Opal a new_hope

Forml

Sunday, November 10, 13

Page 162: Opal a new_hope

Forml

Sunday, November 10, 13

Page 163: Opal a new_hope

Other attempts to do Ruby in JS

Sunday, November 10, 13

Page 164: Opal a new_hope

people want ruby in the

browser

Sunday, November 10, 13

Page 165: Opal a new_hope

even if they don’t know it

Sunday, November 10, 13

Page 166: Opal a new_hope

some know they don’t want js

Sunday, November 10, 13

Page 167: Opal a new_hope

some know they don’t want js

Javascript...

It’s s**tI never use it

Sunday, November 10, 13

Page 168: Opal a new_hope

some know they don’t want js

Javascript...

It’s s**tI never use it

ripoff of the Smug DHH meme

Sunday, November 10, 13

Page 169: Opal a new_hope

instead of the adhoc, informally

specified, bug ridden, slow

implementation...

Sunday, November 10, 13

Page 170: Opal a new_hope

Opal

Sunday, November 10, 13

Page 171: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

Sunday, November 10, 13

Page 172: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

Sunday, November 10, 13

Page 173: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

Sunday, November 10, 13

Page 174: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

• modular code

Sunday, November 10, 13

Page 175: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

• modular code

• namespaces

Sunday, November 10, 13

Page 176: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

• modular code

• namespaces

• external templates

Sunday, November 10, 13

Page 177: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

• modular code

• namespaces

• external templates

• automation tasks

Sunday, November 10, 13

Page 178: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• could be its own presentation, only selected examples

• comparisons

• modular code

• namespaces

• external templates

• automation tasks

• scope

Sunday, November 10, 13

Page 179: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

Sunday, November 10, 13

Page 180: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• non comparision

Sunday, November 10, 13

Page 181: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• non comparision

• dom

Sunday, November 10, 13

Page 182: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• non comparision

• dom

• css

Sunday, November 10, 13

Page 183: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• non comparision

• dom

• css

• javascript integration

Sunday, November 10, 13

Page 184: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• non comparision

• dom

• css

• javascript integration

• testing

Sunday, November 10, 13

Page 185: Opal a new_hope

modular code: Javascript

Sunday, November 10, 13

Page 186: Opal a new_hope

modular code: Javascript

define( module_id /*optional*/, [dependencies] /*optional*/, definition function /*function for instantiating the module or object*/);// Consider 'foo' and 'bar' are two external modules// In this example, the 'exports' from the two modules loaded are passed as// function arguments to the callback (foo and bar)// so that they can similarly be accessed

Sunday, November 10, 13

Page 187: Opal a new_hope

modular code: Javascript

define( module_id /*optional*/, [dependencies] /*optional*/, definition function /*function for instantiating the module or object*/);// Consider 'foo' and 'bar' are two external modules// In this example, the 'exports' from the two modules loaded are passed as// function arguments to the callback (foo and bar)// so that they can similarly be accessed

require(['foo', 'bar'], function ( foo, bar ) { // rest of your code here foo.doSomething();});

Sunday, November 10, 13

Page 188: Opal a new_hope

modular code: Javascript

define( module_id /*optional*/, [dependencies] /*optional*/, definition function /*function for instantiating the module or object*/);// Consider 'foo' and 'bar' are two external modules// In this example, the 'exports' from the two modules loaded are passed as// function arguments to the callback (foo and bar)// so that they can similarly be accessed

require(['foo', 'bar'], function ( foo, bar ) { // rest of your code here foo.doSomething();});

Lots of other stuff

Sunday, November 10, 13

Page 189: Opal a new_hope

MODULAR CODE - ruby

Sunday, November 10, 13

Page 190: Opal a new_hope

MODULAR CODE - ruby

create a ruby file or gem

Sunday, November 10, 13

Page 191: Opal a new_hope

MODULAR CODE - ruby

require 'file_or_gem_you_want'

create a ruby file or gem

Sunday, November 10, 13

Page 192: Opal a new_hope

MODULAR CODE - Opal

Sunday, November 10, 13

Page 193: Opal a new_hope

MODULAR CODE - Opal

create a ruby file or gem

Sunday, November 10, 13

Page 194: Opal a new_hope

MODULAR CODE - Opal

require 'file_or_gem_you_want'

create a ruby file or gem

Sunday, November 10, 13

Page 195: Opal a new_hope

example from opal-irb

require 'opal'require 'opal-jquery'require 'opal-parser'require 'opal_irb_jqconsole'

Document.ready? do OpalIrbJqconsole.create("#console")end

Sunday, November 10, 13

Page 196: Opal a new_hope

example from opal-irb

require 'opal'require 'opal-jquery'require 'opal-parser'require 'opal_irb_jqconsole'

Document.ready? do OpalIrbJqconsole.create("#console")end

require gems

Sunday, November 10, 13

Page 197: Opal a new_hope

example from opal-irb

require 'opal'require 'opal-jquery'require 'opal-parser'require 'opal_irb_jqconsole'

Document.ready? do OpalIrbJqconsole.create("#console")end

require gems

require my file

Sunday, November 10, 13

Page 198: Opal a new_hope

example from opal-irb

require 'opal'require 'opal-jquery'require 'opal-parser'require 'opal_irb_jqconsole'

Document.ready? do OpalIrbJqconsole.create("#console")end

require gems

require my file

use it

Sunday, November 10, 13

Page 199: Opal a new_hope

Namespace - JS

Sunday, November 10, 13

Page 200: Opal a new_hope

Namespace - JS

• many ways

Sunday, November 10, 13

Page 201: Opal a new_hope

Namespace - JS

• many ways

• hand rolling nested objects

Sunday, November 10, 13

Page 202: Opal a new_hope

Namespace - JS

• many ways

• hand rolling nested objects

• namespace functions, self coded, Yui, Dojo

Sunday, November 10, 13

Page 203: Opal a new_hope

Namespace - JSby hand

or like this

Sunday, November 10, 13

Page 204: Opal a new_hope

Namespace - JS

Sunday, November 10, 13

Page 205: Opal a new_hope

Namespace - JSas a function

Sunday, November 10, 13

Page 206: Opal a new_hope

Namespace - JSas a function

function definition

Sunday, November 10, 13

Page 207: Opal a new_hope

namespace - ruby

• use module or class

Sunday, November 10, 13

Page 208: Opal a new_hope

namespace - opal

• use module or class

Sunday, November 10, 13

Page 209: Opal a new_hope

templates as external files: jsT

Sunday, November 10, 13

Page 210: Opal a new_hope

templates as external files: jsT

write jst template

Sunday, November 10, 13

Page 211: Opal a new_hope

templates as external files: jsT

write jst template

include in html

Sunday, November 10, 13

Page 212: Opal a new_hope

templates as external files: jsT

write jst template

include in html

use

Sunday, November 10, 13

Page 213: Opal a new_hope

templates as external files- Rails

• make external template file

• render # if you even have to

Sunday, November 10, 13

Page 214: Opal a new_hope

templates as external files -

• make external template file

• require “filename”

• Template[“filename”].render

Sunday, November 10, 13

Page 215: Opal a new_hope

automation tasks - js

Sunday, November 10, 13

Page 216: Opal a new_hope

automation tasks - js

• cake

Sunday, November 10, 13

Page 217: Opal a new_hope

automation tasks - js

• cake

• grunt

Sunday, November 10, 13

Page 218: Opal a new_hope

automation tasks - js

• cake

• grunt

• something new?

Sunday, November 10, 13

Page 219: Opal a new_hope

automation tasks - ruby

• rake

Sunday, November 10, 13

Page 220: Opal a new_hope

AUTOMATION TASKS -OPAL

• RAKE

Sunday, November 10, 13

Page 221: Opal a new_hope

scope - js

• wrap everything in a function

• while  (i  <  2)  {

       funcArray[i]  =  (function(value)  {                  return  function(){  alert(value);  return  false;  }        })(i);        i++;}

Sunday, November 10, 13

Page 222: Opal a new_hope

scope - ruby

• much more flexible and sane rules

Sunday, November 10, 13

Page 223: Opal a new_hope

scope - opal

• see ruby

Sunday, November 10, 13

Page 224: Opal a new_hope

defer execution - js

• var immediateId = window.setImmediate(function() { code_you_want});

Sunday, November 10, 13

Page 225: Opal a new_hope

DEFER EXECUTION - opal-browser

• proc { code_you_want }.defer

Sunday, November 10, 13

Page 226: Opal a new_hope

javascript integration

Sunday, November 10, 13

Page 227: Opal a new_hope

javascript integration

• x-strings

Sunday, November 10, 13

Page 228: Opal a new_hope

javascript integration

• x-strings

• %x(window.location)

Sunday, November 10, 13

Page 229: Opal a new_hope

javascript integration

• x-strings

• %x(window.location)

• `window.location`

Sunday, November 10, 13

Page 230: Opal a new_hope

javascript integration

• x-strings

• %x(window.location)

• `window.location`

• used to have seemless bridging (via method missing) like jruby, now need to wrap objects with native

Sunday, November 10, 13

Page 231: Opal a new_hope

javascript integration

• x-strings

• %x(window.location)

• `window.location`

• used to have seemless bridging (via method missing) like jruby, now need to wrap objects with native

• @editor = Native(`CodeMirror.fromTextArea(areas)`)

Sunday, November 10, 13

Page 232: Opal a new_hope

DOM - opal-browser

Sunday, November 10, 13

Page 233: Opal a new_hope

DOM - opal-browser

create dom

Sunday, November 10, 13

Page 234: Opal a new_hope

DOM - opal-browser

create dom

get by id

Sunday, November 10, 13

Page 235: Opal a new_hope

DOM - opal-browser

create dom

get by id

ways to append

Sunday, November 10, 13

Page 236: Opal a new_hope

CSS opal-browser

Sunday, November 10, 13

Page 237: Opal a new_hope

CSS opal-browser

create css

Sunday, November 10, 13

Page 238: Opal a new_hope

CSS opal-browser

create css

append to head

Sunday, November 10, 13

Page 239: Opal a new_hope

Tests/Specs

Sunday, November 10, 13

Page 240: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

Sunday, November 10, 13

Page 241: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• not done (but easy in ruby)

Sunday, November 10, 13

Page 242: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• not done (but easy in ruby)

• monkey patching

Sunday, November 10, 13

Page 243: Opal a new_hope

3. Solves things the Ruby way, making the programmer happy

• not done (but easy in ruby)

• monkey patching

• method missing

Sunday, November 10, 13

Page 244: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)

Sunday, November 10, 13

Page 245: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)

Sunday, November 10, 13

Page 246: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)

• opal-irb, opal-inspector easy to write without a framework, very few lines

Sunday, November 10, 13

Page 247: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)

• opal-irb, opal-inspector easy to write without a framework, very few lines

• power of a better language

Sunday, November 10, 13

Page 248: Opal a new_hope

opal-inspector spike code

Sunday, November 10, 13

Page 249: Opal a new_hope

opal-inspector spike code

• 448 lines including whitespace and debugging lines

Sunday, November 10, 13

Page 250: Opal a new_hope

opal-inspector spike code

• 448 lines including whitespace and debugging lines

• mostly just plain ruby w/some opal-jquery

Sunday, November 10, 13

Page 251: Opal a new_hope

opal-inspector spike code

• 448 lines including whitespace and debugging lines

• mostly just plain ruby w/some opal-jquery

• selected code showN

Sunday, November 10, 13

Page 252: Opal a new_hope

Sunday, November 10, 13

Page 253: Opal a new_hope

Require gems

Sunday, November 10, 13

Page 254: Opal a new_hope

Require gems

Require tempates

Sunday, November 10, 13

Page 255: Opal a new_hope

Require gems

Require tempates

Render template

Sunday, November 10, 13

Page 256: Opal a new_hope

App setup

Sunday, November 10, 13

Page 257: Opal a new_hope

App setup

Add panes

Sunday, November 10, 13

Page 258: Opal a new_hope

App setup

Add panesjQuery stuff

Sunday, November 10, 13

Page 259: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)

Sunday, November 10, 13

Page 260: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

Sunday, November 10, 13

Page 261: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

• opal-jquery - jquery wrapped in a ruby way

Sunday, November 10, 13

Page 262: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

• opal-jquery - jquery wrapped in a ruby way

• opal-browser - browser functionality

Sunday, November 10, 13

Page 263: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

• opal-jquery - jquery wrapped in a ruby way

• opal-browser - browser functionality

• can use iN lieu of opal-jquery if you’re not using jquery

Sunday, November 10, 13

Page 264: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

• opal-jquery - jquery wrapped in a ruby way

• opal-browser - browser functionality

• can use iN lieu of opal-jquery if you’re not using jquery

• vienna - MVC

Sunday, November 10, 13

Page 265: Opal a new_hope

4. Frameworks, we don't need no stinking frameworks

(but we have some)• while ruby is powerful by itself, opal have

some libs

• opal-jquery - jquery wrapped in a ruby way

• opal-browser - browser functionality

• can use iN lieu of opal-jquery if you’re not using jquery

• vienna - MVC

• lissio - MVC

Sunday, November 10, 13

Page 266: Opal a new_hope

5. Tools you already know and love

Sunday, November 10, 13

Page 267: Opal a new_hope

5. Tools you already know and love

• opal is Ruby

Sunday, November 10, 13

Page 268: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.

Sunday, November 10, 13

Page 269: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.• Rake

Sunday, November 10, 13

Page 270: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.• Rake• rspec (sorry DHH)

Sunday, November 10, 13

Page 271: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.• Rake• rspec (sorry DHH)• guard

Sunday, November 10, 13

Page 272: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.• Rake• rspec (sorry DHH)• guard• <fill in the ruby tool> - remember it's just Ruby

Sunday, November 10, 13

Page 273: Opal a new_hope

5. Tools you already know and love

• opal is Ruby• editor - emacs, textmate, vim,

sublime, Rubymine, etc.• Rake• rspec (sorry DHH)• guard• <fill in the ruby tool> - remember it's just Ruby

• Reuse your ood and patterns Knowledge

Sunday, November 10, 13

Page 274: Opal a new_hope

Sunday, November 10, 13

Page 275: Opal a new_hope

6. Easy integration with Ruby web frameworks

Sunday, November 10, 13

Page 276: Opal a new_hope

6. Easy integration with Ruby web frameworks

• opal-rails

Sunday, November 10, 13

Page 277: Opal a new_hope

6. Easy integration with Ruby web frameworks

• opal-rails

• opal-sprockets

Sunday, November 10, 13

Page 278: Opal a new_hope

6. Easy integration with Ruby web frameworks

• opal-rails

• opal-sprockets

• opal-server

Sunday, November 10, 13

Page 279: Opal a new_hope

opal-rails

• The easy way

• rails new new_project --javascript=opal

Sunday, November 10, 13

Page 280: Opal a new_hope

opal-rails

Sunday, November 10, 13

Page 281: Opal a new_hope

opal-railsadd to gemfile

Sunday, November 10, 13

Page 282: Opal a new_hope

opal-railsadd to gemfile

add to APPLICATION.JS

Sunday, November 10, 13

Page 283: Opal a new_hope

opal-railsadd to gemfile

add to APPLICATION.JS

EDIT *.JS.RB FILE

Sunday, November 10, 13

Page 284: Opal a new_hope

opal-railsadd to gemfile

add to APPLICATION.JS

EDIT *.JS.RB FILE

HAML FILTERS SUPPORTED

Sunday, November 10, 13

Page 285: Opal a new_hope

opal-railsadd to gemfile

add to APPLICATION.JS

EDIT *.JS.RB FILE

HAML FILTERS SUPPORTED

add SPECS

Sunday, November 10, 13

Page 286: Opal a new_hope

opal-sprocketsFOR NON RAILS STANDALONE -

RAKEFILErequire 'bundler/setup'require 'opal'require 'opal-sprockets'

desc "build jqconsole based irb"task :build_jqconsole do

File.open("js/app-jqconsole.js", "w+") do |out| env = Opal::Environment.new env.append_path "examples" env.append_path "opal" out << env["app-jqconsole"].to_s end # system "terminal-notifier -title 'opal-irb build' -message 'js file built'" system "open -a 'Google Chrome' index-jq.html"end

Sunday, November 10, 13

Page 287: Opal a new_hope

opal-sprocketsFOR NON RAILS STANDALONE -

RAKEFILErequire 'bundler/setup'require 'opal'require 'opal-sprockets'

desc "build jqconsole based irb"task :build_jqconsole do

File.open("js/app-jqconsole.js", "w+") do |out| env = Opal::Environment.new env.append_path "examples" env.append_path "opal" out << env["app-jqconsole"].to_s end # system "terminal-notifier -title 'opal-irb build' -message 'js file built'" system "open -a 'Google Chrome' index-jq.html"end

file to write to

Sunday, November 10, 13

Page 288: Opal a new_hope

opal-sprocketsFOR NON RAILS STANDALONE -

RAKEFILErequire 'bundler/setup'require 'opal'require 'opal-sprockets'

desc "build jqconsole based irb"task :build_jqconsole do

File.open("js/app-jqconsole.js", "w+") do |out| env = Opal::Environment.new env.append_path "examples" env.append_path "opal" out << env["app-jqconsole"].to_s end # system "terminal-notifier -title 'opal-irb build' -message 'js file built'" system "open -a 'Google Chrome' index-jq.html"end

file to write to

append dirs to search

Sunday, November 10, 13

Page 289: Opal a new_hope

opal-sprocketsFOR NON RAILS STANDALONE -

RAKEFILErequire 'bundler/setup'require 'opal'require 'opal-sprockets'

desc "build jqconsole based irb"task :build_jqconsole do

File.open("js/app-jqconsole.js", "w+") do |out| env = Opal::Environment.new env.append_path "examples" env.append_path "opal" out << env["app-jqconsole"].to_s end # system "terminal-notifier -title 'opal-irb build' -message 'js file built'" system "open -a 'Google Chrome' index-jq.html"end

file to write to

append dirs to search

write contents

Sunday, November 10, 13

Page 290: Opal a new_hope

opal-server

Sunday, November 10, 13

Page 291: Opal a new_hope

opal-serveradd to gemfile

Sunday, November 10, 13

Page 292: Opal a new_hope

opal-serveradd to gemfile

create your opal file(s)

Sunday, November 10, 13

Page 293: Opal a new_hope

opal-serveradd to gemfile

create your opal file(s)

include application.js

Sunday, November 10, 13

Page 294: Opal a new_hope

opal-serveradd to gemfile

create your opal file(s)

include application.js

setup config.ru

Sunday, November 10, 13

Page 295: Opal a new_hope

opal-serveradd to gemfile

create your opal file(s)

include application.js

setup config.ru

rackup and refresh at will

Sunday, November 10, 13

Page 296: Opal a new_hope

7. Awesome In Browser tools

• opal-irb

• opal-inspector

Sunday, November 10, 13

Page 297: Opal a new_hope

opal-irb

Sunday, November 10, 13

Page 298: Opal a new_hope

opal-irb

• irb for opal

Sunday, November 10, 13

Page 299: Opal a new_hope

opal-irb

• irb for opal

• history

Sunday, November 10, 13

Page 300: Opal a new_hope

opal-irb

• irb for opal

• history

• readline controls (most)

Sunday, November 10, 13

Page 301: Opal a new_hope

opal-irb

• irb for opal

• history

• readline controls (most)

• popup multiline editor (works over all history)

Sunday, November 10, 13

Page 302: Opal a new_hope

opal-irb

• irb for opal

• history

• readline controls (most)

• popup multiline editor (works over all history)

• send a link (live gist)

Sunday, November 10, 13

Page 303: Opal a new_hope

opal-inspector

Sunday, November 10, 13

Page 304: Opal a new_hope

opal-inspector

• inspired by amber.js’s in browser smalltalk code browser

Sunday, November 10, 13

Page 305: Opal a new_hope

opal-inspector

• inspired by amber.js’s in browser smalltalk code browser

• persistent live opal objects is similar to the Smalltalk image

Sunday, November 10, 13

Page 306: Opal a new_hope

opal-inspector

• inspired by amber.js’s in browser smalltalk code browser

• persistent live opal objects is similar to the Smalltalk image

• change the paradigm of webapp development

Sunday, November 10, 13

Page 307: Opal a new_hope

opal-inspector

• inspired by amber.js’s in browser smalltalk code browser

• persistent live opal objects is similar to the Smalltalk image

• change the paradigm of webapp development

• develop in browser w/better tools

Sunday, November 10, 13

Page 308: Opal a new_hope

demos

Sunday, November 10, 13

Page 309: Opal a new_hope

opal-irb demo

• ruby

• invoke js

• multi line

• multi line edit

• dom example

• css example

• “live gist”

Sunday, November 10, 13

Page 310: Opal a new_hope

opal-inspector demo

• tabs overview

• show transcript

• class browser

• instance browser

Sunday, November 10, 13

Page 311: Opal a new_hope

OPAL-INSPECTOR

• WAiting on a feature from the opal parser to store code and comments

Sunday, November 10, 13

Page 312: Opal a new_hope

Sunday, November 10, 13

Page 313: Opal a new_hope

8. New possibilities

Sunday, November 10, 13

Page 314: Opal a new_hope

8. New possibilities

• in browser development

Sunday, November 10, 13

Page 315: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

Sunday, November 10, 13

Page 316: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

Sunday, November 10, 13

Page 317: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

• finally a standard Ui platform

Sunday, November 10, 13

Page 318: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

• finally a standard Ui platform

• fragmented/stagnant before, gtk, wxwindows, qt, tk, etc.

Sunday, November 10, 13

Page 319: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

• finally a standard Ui platform

• fragmented/stagnant before, gtk, wxwindows, qt, tk, etc.

• everyone has a browser

Sunday, November 10, 13

Page 320: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

• finally a standard Ui platform

• fragmented/stagnant before, gtk, wxwindows, qt, tk, etc.

• everyone has a browser

• use these tools for backend too, ala better errors

Sunday, November 10, 13

Page 321: Opal a new_hope

8. New possibilities

• in browser development

• change the development paradigm

• take goodness from Smalltalk, ruby, lisp machines

• finally a standard Ui platform

• fragmented/stagnant before, gtk, wxwindows, qt, tk, etc.

• everyone has a browser

• use these tools for backend too, ala better errors

• better tooling for ruby across the board

Sunday, November 10, 13

Page 322: Opal a new_hope

8. New possibilities

Sunday, November 10, 13

Page 323: Opal a new_hope

8. New possibilities

• meteor.js like same code on front and back end

Sunday, November 10, 13

Page 324: Opal a new_hope

8. New possibilities

• meteor.js like same code on front and back end

• blurring the lines - vienna experiment

Sunday, November 10, 13

Page 325: Opal a new_hope

8. New possibilities

• meteor.js like same code on front and back end

• blurring the lines - vienna experiment

• eventd safe ruby libs

Sunday, November 10, 13

Page 326: Opal a new_hope

8. New possibilities

• meteor.js like same code on front and back end

• blurring the lines - vienna experiment

• eventd safe ruby libs

• as opal matures, eventd safe ruby libs/gems for both front and backend

Sunday, November 10, 13

Page 327: Opal a new_hope

8. New possibilities

Sunday, November 10, 13

Page 328: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

Sunday, November 10, 13

Page 329: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

• hard to do oo programming with markup and css

Sunday, November 10, 13

Page 330: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

• hard to do oo programming with markup and css

• lissio - ruby class, all parts in ruby

Sunday, November 10, 13

Page 331: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

• hard to do oo programming with markup and css

• lissio - ruby class, all parts in ruby

• html

Sunday, November 10, 13

Page 332: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

• hard to do oo programming with markup and css

• lissio - ruby class, all parts in ruby

• html

• css

Sunday, November 10, 13

Page 333: Opal a new_hope

8. New possibilities

• component based coding, all in one place for the web

• hard to do oo programming with markup and css

• lissio - ruby class, all parts in ruby

• html

• css

• behavior

Sunday, November 10, 13

Page 334: Opal a new_hope

Sunday, November 10, 13

Page 335: Opal a new_hope

behavior

Sunday, November 10, 13

Page 336: Opal a new_hope

behavior

element

Sunday, November 10, 13

Page 337: Opal a new_hope

behavior

element

html

Sunday, November 10, 13

Page 338: Opal a new_hope

behavior

element

html

css

Sunday, November 10, 13

Page 339: Opal a new_hope

behavior

element

html

css

all ruby

Sunday, November 10, 13

Page 340: Opal a new_hope

nested css

Sunday, November 10, 13

Page 341: Opal a new_hope

8. New possibilities

Sunday, November 10, 13

Page 342: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

Sunday, November 10, 13

Page 343: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

Sunday, November 10, 13

Page 344: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

Sunday, November 10, 13

Page 345: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

Sunday, November 10, 13

Page 346: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

Sunday, November 10, 13

Page 347: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

• embedded mruby

Sunday, November 10, 13

Page 348: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

• embedded mruby

• mobile

Sunday, November 10, 13

Page 349: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

• embedded mruby

• mobile

• rubymotion

Sunday, November 10, 13

Page 350: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

• embedded mruby

• mobile

• rubymotion

• mobiruby

Sunday, November 10, 13

Page 351: Opal a new_hope

8. New possibilities

• can you imagine a world w/o ruby?

• possible w/the javascript revolution

• facilitate the fantasy land of ruby everywhere

• backend mri, jruby, rubinius

• mirah - everywhere jvm runs

• embedded mruby

• mobile

• rubymotion

• mobiruby

• opal - everywhere javascript runs

Sunday, November 10, 13

Page 352: Opal a new_hope

(dubious) history as starwars

films

Sunday, November 10, 13

Page 353: Opal a new_hope

Episode 1: The Phantom JS Menace

Mesa use Javascript on the backend!Mesa use Javascript everywhere!!!!

Mesa use Javascript in ways unintended...

Sunday, November 10, 13

Page 354: Opal a new_hope

Episode 2: Attack of the Clones

Coffescript

Typescript DartJSX Fantom

Sunday, November 10, 13

Page 355: Opal a new_hope

Episode 3: Revenge of the Sith

http://conquent.com/bissellator/blogimg/darth_gates.jpg

Windows 8 development using Javascript.Evil Empire complete

Sunday, November 10, 13

Page 356: Opal a new_hope

Episode 4: A New Hope

OPAL Wan Kenobi,you’re my only hope

Sunday, November 10, 13

Page 357: Opal a new_hope

Episode 5: The Empire Strikes Back

Join us, we have Ecmascript 6

Sunday, November 10, 13

Page 358: Opal a new_hope

Episode 6: Return of the Jedi

Opal Viable, New Deathstar explodes

Sunday, November 10, 13

Page 359: Opal a new_hope

Episode 7: TBD

http://www.copywritematters.com.au/dev/wp-content/uploads/2011/09/Lady-Pointing-To-You-Small-.jpg

Sunday, November 10, 13

Page 360: Opal a new_hope

Episode 7: TBD

http://www.copywritematters.com.au/dev/wp-content/uploads/2011/09/Lady-Pointing-To-You-Small-.jpg

Sunday, November 10, 13

Page 361: Opal a new_hope

Sunday, November 10, 13

Page 362: Opal a new_hope

Call to arms

Sunday, November 10, 13

Page 363: Opal a new_hope

Call to arms

• hope for momentum like rubinius

Sunday, November 10, 13

Page 364: Opal a new_hope

Call to arms

• hope for momentum like rubinius

• rubyconf 06 - just an idea

Sunday, November 10, 13

Page 365: Opal a new_hope

Call to arms

• hope for momentum like rubinius

• rubyconf 06 - just an idea

• rubyconf 07 - a movement

Sunday, November 10, 13

Page 366: Opal a new_hope

Call to arms

• hope for momentum like rubinius

• rubyconf 06 - just an idea

• rubyconf 07 - a movement

• opal is farther along, if we could make similar progress...

Sunday, November 10, 13

Page 367: Opal a new_hope

right now

Sunday, November 10, 13

Page 368: Opal a new_hope

right now

• things are pretty good

Sunday, November 10, 13

Page 369: Opal a new_hope

right now

• things are pretty good

• things could be better

Sunday, November 10, 13

Page 370: Opal a new_hope

right now

• things are pretty good

• things could be better

• more ruby compatibility

Sunday, November 10, 13

Page 371: Opal a new_hope

right now

• things are pretty good

• things could be better

• more ruby compatibility

• more libs, complete libs **

Sunday, November 10, 13

Page 372: Opal a new_hope

right now

• things are pretty good

• things could be better

• more ruby compatibility

• more libs, complete libs **

• documentation

Sunday, November 10, 13

Page 373: Opal a new_hope

right now

• things are pretty good

• things could be better

• more ruby compatibility

• more libs, complete libs **

• documentation

• we need your helP

Sunday, November 10, 13

Page 374: Opal a new_hope

things to do

Sunday, November 10, 13

Page 375: Opal a new_hope

things to do

• try it out,

Sunday, November 10, 13

Page 376: Opal a new_hope

things to do

• try it out, • opalrb.org/try

Sunday, November 10, 13

Page 377: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html

Sunday, November 10, 13

Page 378: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group

Sunday, November 10, 13

Page 379: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document

Sunday, November 10, 13

Page 380: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document• contribute, it’s just ruby

Sunday, November 10, 13

Page 381: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document• contribute, it’s just ruby• convert gems******, write new stuff, test, etc..

Sunday, November 10, 13

Page 382: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document• contribute, it’s just ruby• convert gems******, write new stuff, test, etc..• be a garbage collector, change the world

Sunday, November 10, 13

Page 383: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document• contribute, it’s just ruby• convert gems******, write new stuff, test, etc..• be a garbage collector, change the world

• have fun

Sunday, November 10, 13

Page 384: Opal a new_hope

things to do

• try it out, • opalrb.org/try• http://fkchang.github.io/opal-irb/index-

embeddable.html • communicate - irc, google group• document• contribute, it’s just ruby• convert gems******, write new stuff, test, etc..• be a garbage collector, change the world

• have fun• be happy

Sunday, November 10, 13

Page 385: Opal a new_hope

will you

• join the dark side?

Sunday, November 10, 13

Page 386: Opal a new_hope

or

• code with the force?

Sunday, November 10, 13

Page 387: Opal a new_hope

you choose

Sunday, November 10, 13

Page 388: Opal a new_hope

But for me

Sunday, November 10, 13

Page 389: Opal a new_hope

change the world, defeat the evil

Sunday, November 10, 13

Page 390: Opal a new_hope

resources

• opalrb.org

• github.com/opal

• irc opal

• google groups - not very active

• my blog funkworks.blogspot.com

• not a lot, but better than nothing

• more soon

Sunday, November 10, 13

Page 391: Opal a new_hope

thankful I am, for the garbage collectors

Sunday, November 10, 13

Page 392: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

Sunday, November 10, 13

Page 393: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

• dhh - rails

Sunday, November 10, 13

Page 394: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

• dhh - rails

• adam, meh, elia - opal

Sunday, November 10, 13

Page 395: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

• dhh - rails

• adam, meh, elia - opal

• ruby and rails communities

Sunday, November 10, 13

Page 396: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

• dhh - rails

• adam, meh, elia - opal

• ruby and rails communities

• George Lucas

Sunday, November 10, 13

Page 397: Opal a new_hope

thankful I am, for the garbage collectors

• matz - ruby

• dhh - rails

• adam, meh, elia - opal

• ruby and rails communities

• George Lucas

• you

Sunday, November 10, 13

Page 398: Opal a new_hope

hedgeye

• hiring like everyone else

• NYC Area, Stamford CT

Sunday, November 10, 13

Page 399: Opal a new_hope

may the force be with you

@fkchang2000

Sunday, November 10, 13