SlideShare a Scribd company logo
Long Live the Rubyists!
Kane Baccigalupi
@rubyghetto
Life After Ruby
But WHY???
:(
Ruby is!
• expressive
“hello ” * 4
“hello hello hello hello ”
Ruby is!
• expressive
• principle of least surprise
“hello”.empty?
“hello”.include?(“hell”)
Ruby is!
• expressive
• principle of least surprise
• powerful
class Object
def wat
“wat? wat?”
end
end
“foo”.wat # “wat? wat?”
Ruby is!
• expressive
• principle of least surprise
• powerful
• libs!
Rails!
So what’s
the problem???
Oh crap!
Concurrency :(
–Tony Arcieri, creator of Celluloid gem
"Eventually you're in a place where
you're trying to build a jet engine out
of silly putty."
Where’s the goo?
Where’s the goo?
MUTABLE STATE
Where’s the goo?
MUTABLE STATE
def cambiarse!
@changed = true
end
Functional
Programming
to the rescue!
Functional programmers believe functional
programming is about keeping state immutable
Mutating Ruby:
greeting = “hello"
greeting.upcase!
greeting.gsub!("HELL", “heaven")
greeting # “heavenO”
Non-Mutating Ruby:
greeting = “hello"
greeting.upcase.gsub("HELL", “heaven")
greeting # “hello”
So let’s switch to
functional programming
(define checkbook (lambda ()
; This check book balancing program was written to illustrate
; i/o in Scheme. It uses the purely functional part of Scheme.
; These definitions are local to checkbook
(letrec
; These strings are used as prompts
((IB "Enter initial balance: ")
(AT "Enter transaction (- for withdrawal): ")
(FB "Your final balance is: ")
; This function displays a prompt then returns
; a value read.
(prompt-read (lambda (Prompt)
(display Prompt)
(read)))
; This function recursively computes the new
; balance given an initial balance init and
; a new value t. Termination occurs when the
; new value is 0.
(newbal (lambda (Init t)
(if (= t 0)
(list FB Init)
(transaction (+ Init t)))))
; This function prompts for and reads the next
; transaction and passes the information to newbal
(transaction (lambda (Init)
(newbal Init (prompt-read AT)))))
; This is the body of checkbook; it prompts for the
; starting balance
(transaction (prompt-read IB)))))
Object Oriented
programming to the
rescue!
Object oriented programmers believe object oriented
coding is breaking code into modular abstractions
Immutable Objects?
FAUXY!
FAUXY!
Faux Objects
FAUXY!
Faux Functional
FAUXY!
Oops, no logo though
FAUXY!
Oops, no logo though.
And `1 + 1` still doesn’t equal `2`
Lexing
Breaking a string of characters into
a string of tokens
1 + 1
<integer 1> <id ‘+’> <integer 1>
ParsingTaking a string of tokens and
converting it into tree of expressions
<integer 1> <id ‘+’> <integer 1>
(method_call,
(receiver, <integer 1>),
(message, <id ‘+’>),
(arguments, (<integer 1>))
)
Interpretation
Taking the tree expression
and executing it as code!
(method_call,
(receiver, <integer 1>),
(message, <id ‘+’>),
(arguments, (<integer 1>))
)
• Find or build literal integer `1`
• Use Integer class to lookup `+`
method
• Find literal integer `1` again to use
as an argument
• Call `+` method with found literals
`1` and `1` as the receiver and
the message
FAUXY!
What does it look like though?
FAUXY! - Multiple Dispatch
NumberToWords.Digit: Class.new(n) -> {
to-words: -> { convert(n) }
convert: -> (n: 1) { 'one' }
convert: -> (n: 2) { 'two' }
convert: -> (n: 3) { 'three' }
convert: -> (n: 4) { 'four' }
convert: -> (n: 5) { 'five' }
convert: -> (n: 6) { 'six' }
convert: -> (n: 7) { 'seven' }
convert: -> (n: 8) { 'eight' }
convert: -> (n: 9) { 'nine' }
}
FAUXY! - Pipes & Streams
a(x) >> b(:foo, _.value) >> c(_, 'bar')
DataParser.new(data) >> DbRecord.new(_).create
Aggregating State
Spec: Class.new(description, block) -> {
setup: -> {
results: List.new
}
run: -> {
block.run
}
assert: -> (value) {
results.add(value.to_boolean)
}
failure-count: -> {
results.count -> (boolean) { !boolean }
}
success?: -> {
results.count > 1 && failure-count == 0
}
}
FAUXY!
Watch it happen:
github.com/baccigalupi/fauxy
Attributions
• Ruby icon: www.computersnyou.com
• Confreaks Screenshot of Ernie Miller @rubyconf 2014:
https://www.youtube.com/watch?v=EgjJYkuV0Sc
• Wat: https://www.destroyallsoftware.com/talks/wat
• Rails icon: en.wikipedia.org
• Moore’s Law: www.pcworld.com
• Celluloid: https://celluloid.io/
• Scheme example:
https://classes.soe.ucsc.edu/cmps112/Spring03/languages/scheme/Sche
meTutorialA.html#example
• Immutable Ruby Object Example:
https://github.com/socialchorus/slipcover/blob/master/lib/slipcover/databa
se.rb
• Presentation at: http://www.slideshare.net/baccigalupi/long-live-the-
rubyist
ME!
Kane Baccigalupi
@baccigalupi
Ruby/Rails/JS
Rescue Coding

More Related Content

What's hot

Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers
Robert Dempsey
 
Ruby
RubyRuby
Zhifu Ge - How To Be Weird In Ruby - With Notes
Zhifu Ge - How To Be Weird In Ruby - With NotesZhifu Ge - How To Be Weird In Ruby - With Notes
Zhifu Ge - How To Be Weird In Ruby - With Notes
ottawaruby
 
Introducing Ruby
Introducing RubyIntroducing Ruby
Introducing Ruby
James Thompson
 
Elixir for rubysts
Elixir for rubystsElixir for rubysts
Elixir for rubysts
Danni Friedland
 
Ruby Programming Language - Introduction
Ruby Programming Language - IntroductionRuby Programming Language - Introduction
Ruby Programming Language - Introduction
Kwangshin Oh
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
kim.mens
 
Perl 101
Perl 101Perl 101
Perl 101
Alex Balhatchet
 
Ruby_Basic
Ruby_BasicRuby_Basic
Ruby_Basic
Kushal Jangid
 
Discovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic GroovyDiscovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic Groovy
Naresha K
 
Developing A Procedural Language For Postgre Sql
Developing A Procedural Language For Postgre SqlDeveloping A Procedural Language For Postgre Sql
Developing A Procedural Language For Postgre Sql
Joshua Drake
 

What's hot (11)

Rails for PHP Developers
Rails for PHP DevelopersRails for PHP Developers
Rails for PHP Developers
 
Ruby
RubyRuby
Ruby
 
Zhifu Ge - How To Be Weird In Ruby - With Notes
Zhifu Ge - How To Be Weird In Ruby - With NotesZhifu Ge - How To Be Weird In Ruby - With Notes
Zhifu Ge - How To Be Weird In Ruby - With Notes
 
Introducing Ruby
Introducing RubyIntroducing Ruby
Introducing Ruby
 
Elixir for rubysts
Elixir for rubystsElixir for rubysts
Elixir for rubysts
 
Ruby Programming Language - Introduction
Ruby Programming Language - IntroductionRuby Programming Language - Introduction
Ruby Programming Language - Introduction
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Perl 101
Perl 101Perl 101
Perl 101
 
Ruby_Basic
Ruby_BasicRuby_Basic
Ruby_Basic
 
Discovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic GroovyDiscovering functional treasure in idiomatic Groovy
Discovering functional treasure in idiomatic Groovy
 
Developing A Procedural Language For Postgre Sql
Developing A Procedural Language For Postgre SqlDeveloping A Procedural Language For Postgre Sql
Developing A Procedural Language For Postgre Sql
 

Similar to Long Live the Rubyist

Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for Rubyists
Sean Cribbs
 
Java Building Blocks
Java Building BlocksJava Building Blocks
Java Building Blocks
Cate Huston
 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
ssoroka
 
Ruby1_full
Ruby1_fullRuby1_full
Ruby1_full
tutorialsruby
 
Ruby1_full
Ruby1_fullRuby1_full
Ruby1_full
tutorialsruby
 
Ruby basics
Ruby basicsRuby basics
Ruby basics
Tushar Pal
 
Haskell @ HAN Arnhem 2013-2014
Haskell @ HAN Arnhem 2013-2014Haskell @ HAN Arnhem 2013-2014
Haskell @ HAN Arnhem 2013-2014
Tjeerd Hans Terpstra
 
Children of Ruby
Children of RubyChildren of Ruby
Children of Ruby
Simon St.Laurent
 
Ruby — An introduction
Ruby — An introductionRuby — An introduction
Ruby — An introduction
Gonçalo Silva
 
What the C?
What the C?What the C?
What the C?
baccigalupi
 
Querying rich text with XQuery
Querying rich text with XQueryQuerying rich text with XQuery
Querying rich text with XQuery
lucenerevolution
 
Rails console
Rails consoleRails console
Rails console
Reuven Lerner
 
Ruby seen by a C# developer
Ruby seen by a C# developerRuby seen by a C# developer
Ruby seen by a C# developer
Emanuele DelBono
 
Ruby seen from a C# developer
Ruby seen from a C# developerRuby seen from a C# developer
Ruby seen from a C# developer
Codemotion
 
RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!
Gautam Rege
 
Week2
Week2Week2
Week2
reneedv
 
Pete Heroku Waza 2013 Ruby 2.0
Pete Heroku Waza 2013 Ruby 2.0Pete Heroku Waza 2013 Ruby 2.0
Pete Heroku Waza 2013 Ruby 2.0
Peter Hudgins
 
Python assignment help
Python assignment helpPython assignment help
Python assignment help
www.myassignmenthelp.net
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
Sarah Allen
 
Ruby -the wheel Technology
Ruby -the wheel TechnologyRuby -the wheel Technology
Ruby -the wheel Technology
ppparthpatel123
 

Similar to Long Live the Rubyist (20)

Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for Rubyists
 
Java Building Blocks
Java Building BlocksJava Building Blocks
Java Building Blocks
 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
 
Ruby1_full
Ruby1_fullRuby1_full
Ruby1_full
 
Ruby1_full
Ruby1_fullRuby1_full
Ruby1_full
 
Ruby basics
Ruby basicsRuby basics
Ruby basics
 
Haskell @ HAN Arnhem 2013-2014
Haskell @ HAN Arnhem 2013-2014Haskell @ HAN Arnhem 2013-2014
Haskell @ HAN Arnhem 2013-2014
 
Children of Ruby
Children of RubyChildren of Ruby
Children of Ruby
 
Ruby — An introduction
Ruby — An introductionRuby — An introduction
Ruby — An introduction
 
What the C?
What the C?What the C?
What the C?
 
Querying rich text with XQuery
Querying rich text with XQueryQuerying rich text with XQuery
Querying rich text with XQuery
 
Rails console
Rails consoleRails console
Rails console
 
Ruby seen by a C# developer
Ruby seen by a C# developerRuby seen by a C# developer
Ruby seen by a C# developer
 
Ruby seen from a C# developer
Ruby seen from a C# developerRuby seen from a C# developer
Ruby seen from a C# developer
 
RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!
 
Week2
Week2Week2
Week2
 
Pete Heroku Waza 2013 Ruby 2.0
Pete Heroku Waza 2013 Ruby 2.0Pete Heroku Waza 2013 Ruby 2.0
Pete Heroku Waza 2013 Ruby 2.0
 
Python assignment help
Python assignment helpPython assignment help
Python assignment help
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
 
Ruby -the wheel Technology
Ruby -the wheel TechnologyRuby -the wheel Technology
Ruby -the wheel Technology
 

Recently uploaded

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 

Recently uploaded (20)

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 

Long Live the Rubyist