SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Metaprogramming in Ruby ( II )


Thinking in Lisp in Ruby in Lisp in …




                                
                                    http://jon.is.emotionull.com
Creating a language

       Parsers from scratch
       Bison/yacc/lex 
       Metaprogramming FTW!




                                
Bow to the masters

       Lisp
       Scheme
       Forth
       Smalltalk 




                      
Thinking again the problem

       Code as data
       Self modifying code
       Dynamic adding/removing classes/functions
       Describe the problem, don't solve it!




                                
Metaprogramming in the wild

       Web frameworks (Ruby On Rails)
       A.I
       DSL
       Configuration files
       ...




                               
But, hooooow???

       Function pointers (C,C++)
       Open classes (Ruby)
       Metaclasses (Python)
       Lists (Lisp/Scheme/Clojure)




                                
Tools of the trade for Ruby

       Operators Overriding
       OpenClasses
       method_missing
       Blocks and eval
       Lambda




                                
Speed penalty – Not always

       Premature optimization
       Fast and smart VM (JVM)
       Bottleneck is somewhere else (DB)
       You are not smart enough. Deal with it!




                               
Cuby

       Implemented in ~ 10 minutes
       Looks like C
       Feels like C
       FULLY extensible
       Trivial to add new libraries
       You can use available Ruby libs
       VM ~ 25 lines!
                                 
C in Ruby

       Example

         // this is a test (example.cb)
         include ”stdio”
         main {
             printf ”Hello Mr. %s !”, ”Jon”
         }     



                                    
C in Ruby : Functions

       Example

         include ”stdio”
         plea_for_merci_to name {
           shout ”Please don't kill me” + name + ”!”
         }
         main {
             plea_for_merci_to ”Jon”
         }     
                                  
Real usage




         Prediction Modelling




                   
Prediction Modelling

       Lots of data (sometimes more than 60GB)
       Long live C, Fortran, Lisp
       Do you know OpenMP? If not, find another job
       Speed, speed, speed




                                
Predictions in Ruby?

       RubyVM is not very robust (think BIG > 10GB)
       Ruby is slow
       Ruby threading is difficult and bad
       Ruby does not SCALE!




                                
You are right!




          Thanks for watching!




                    
But ruby is slooooow

       1.9 is waaay better than 1.8
       Jruby is the King of the Hill 
       The bottleneck is not really here (hint: DB)




                                 
But ruby cannot scale!

       Threading in RubyVM is bad
       Fibers are way better 
       I love Jruby
         




                                  
Learn from the best: OpenMP

       Standard for parallel processing
       Easy to use
       Very mature library




                               
OpenMP example

       Example

         #pragma omp parallel for
          for (i = 0; i < arraySize; i++){  
               ....
               y[i] = sin( exp( cos( ­ exp( sin(x[i]) ) ) ) );
              ....
            }

                                      
Can we do this in Ruby?

       Example

         for j in 1..30
             puts "Hello from iteration " + j.to_s
               for i in 0..700000
                 c += a[i] * b[­i]
               end
               puts "I have just finished!"
          end 
                                      
In Cuby we trust

       Example
         for j in 1..30
             puts "Hello from iteration " + j.to_s
               parallel {
               for i in 0..700000
                 c += a[i] * b[­i]
               end
               puts "I have just finished!"
               }
                                         
          end 
 


    Thank for watching! Questions?

              Cuby available at: 
    http://github.com/jonromero/Cuby


         http://jon.is.emotionull.com
            jon@emotionull.com
                      

Weitere ähnliche Inhalte

Ähnlich wie Metaprogramming in Ruby

Metaprogramming in Ruby
Metaprogramming in RubyMetaprogramming in Ruby
Metaprogramming in Rubyjonromero
 
Minicurso Ruby e Rails
Minicurso Ruby e RailsMinicurso Ruby e Rails
Minicurso Ruby e RailsSEA Tecnologia
 
Loading... Ruby on Rails 3
Loading... Ruby on Rails 3Loading... Ruby on Rails 3
Loading... Ruby on Rails 3Rafael García
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby DevelopersRenzo Borgatti
 
XRuby_Overview_20070831
XRuby_Overview_20070831XRuby_Overview_20070831
XRuby_Overview_20070831dreamhead
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Rormyuser
 
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar BatsovRuby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar BatsovMichael Kimathi
 
2009 Eclipse Con
2009 Eclipse Con2009 Eclipse Con
2009 Eclipse Conguest29922
 
Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Karel Minarik
 
Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Sean McCune
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Gozhubert
 

Ähnlich wie Metaprogramming in Ruby (20)

Metaprogramming in Ruby
Metaprogramming in RubyMetaprogramming in Ruby
Metaprogramming in Ruby
 
Minicurso Ruby e Rails
Minicurso Ruby e RailsMinicurso Ruby e Rails
Minicurso Ruby e Rails
 
Loading... Ruby on Rails 3
Loading... Ruby on Rails 3Loading... Ruby on Rails 3
Loading... Ruby on Rails 3
 
Ruby
RubyRuby
Ruby
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
IJTC%202009%20JRuby
IJTC%202009%20JRubyIJTC%202009%20JRuby
IJTC%202009%20JRuby
 
IJTC%202009%20JRuby
IJTC%202009%20JRubyIJTC%202009%20JRuby
IJTC%202009%20JRuby
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby Developers
 
Ruby
RubyRuby
Ruby
 
XRuby_Overview_20070831
XRuby_Overview_20070831XRuby_Overview_20070831
XRuby_Overview_20070831
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar BatsovRuby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
Ruby 4.0 To Infinity and Beyond at Ruby Conference Kenya 2017 by Bozhidar Batsov
 
2009 Eclipse Con
2009 Eclipse Con2009 Eclipse Con
2009 Eclipse Con
 
Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)Spoiling The Youth With Ruby (Euruko 2010)
Spoiling The Youth With Ruby (Euruko 2010)
 
Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Ruby basics
Ruby basicsRuby basics
Ruby basics
 

Mehr von John Vlachoyiannis

Making gazillion with cryptocurrencies
Making gazillion with cryptocurrenciesMaking gazillion with cryptocurrencies
Making gazillion with cryptocurrenciesJohn Vlachoyiannis
 
The most epic advice to become an angel investor
The most epic advice to become an angel investorThe most epic advice to become an angel investor
The most epic advice to become an angel investorJohn Vlachoyiannis
 
Music as Data - Ignite 2011 SF
Music as Data - Ignite 2011 SFMusic as Data - Ignite 2011 SF
Music as Data - Ignite 2011 SFJohn Vlachoyiannis
 
This is Appengine! 300 reasons to love Google AppEngine
This is Appengine! 300 reasons to love Google AppEngineThis is Appengine! 300 reasons to love Google AppEngine
This is Appengine! 300 reasons to love Google AppEngineJohn Vlachoyiannis
 
Rain up presentation (erlang factory)
Rain up presentation (erlang factory)Rain up presentation (erlang factory)
Rain up presentation (erlang factory)John Vlachoyiannis
 

Mehr von John Vlachoyiannis (7)

Making gazillion with cryptocurrencies
Making gazillion with cryptocurrenciesMaking gazillion with cryptocurrencies
Making gazillion with cryptocurrencies
 
The most epic advice to become an angel investor
The most epic advice to become an angel investorThe most epic advice to become an angel investor
The most epic advice to become an angel investor
 
Music as Data - Ignite 2011 SF
Music as Data - Ignite 2011 SFMusic as Data - Ignite 2011 SF
Music as Data - Ignite 2011 SF
 
This is Appengine! 300 reasons to love Google AppEngine
This is Appengine! 300 reasons to love Google AppEngineThis is Appengine! 300 reasons to love Google AppEngine
This is Appengine! 300 reasons to love Google AppEngine
 
Music as data
Music as dataMusic as data
Music as data
 
Rain up presentation (erlang factory)
Rain up presentation (erlang factory)Rain up presentation (erlang factory)
Rain up presentation (erlang factory)
 
Clojure Small Intro
Clojure Small IntroClojure Small Intro
Clojure Small Intro
 

Kürzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Metaprogramming in Ruby

  • 2. Creating a language  Parsers from scratch  Bison/yacc/lex   Metaprogramming FTW!    
  • 3. Bow to the masters  Lisp  Scheme  Forth  Smalltalk     
  • 4. Thinking again the problem  Code as data  Self modifying code  Dynamic adding/removing classes/functions  Describe the problem, don't solve it!    
  • 5. Metaprogramming in the wild  Web frameworks (Ruby On Rails)  A.I  DSL  Configuration files  ...    
  • 6. But, hooooow???  Function pointers (C,C++)  Open classes (Ruby)  Metaclasses (Python)  Lists (Lisp/Scheme/Clojure)    
  • 7. Tools of the trade for Ruby  Operators Overriding  OpenClasses  method_missing  Blocks and eval  Lambda    
  • 8. Speed penalty – Not always  Premature optimization  Fast and smart VM (JVM)  Bottleneck is somewhere else (DB)  You are not smart enough. Deal with it!    
  • 9. Cuby  Implemented in ~ 10 minutes  Looks like C  Feels like C  FULLY extensible  Trivial to add new libraries  You can use available Ruby libs  VM ~ 25 lines!    
  • 10. C in Ruby  Example // this is a test (example.cb) include ”stdio” main {     printf ”Hello Mr. %s !”, ”Jon” }         
  • 11. C in Ruby : Functions  Example include ”stdio” plea_for_merci_to name {   shout ”Please don't kill me” + name + ”!” } main {     plea_for_merci_to ”Jon” }         
  • 12. Real usage Prediction Modelling    
  • 13. Prediction Modelling  Lots of data (sometimes more than 60GB)  Long live C, Fortran, Lisp  Do you know OpenMP? If not, find another job  Speed, speed, speed    
  • 14. Predictions in Ruby?  RubyVM is not very robust (think BIG > 10GB)  Ruby is slow  Ruby threading is difficult and bad  Ruby does not SCALE!    
  • 15. You are right! Thanks for watching!    
  • 16. But ruby is slooooow  1.9 is waaay better than 1.8  Jruby is the King of the Hill   The bottleneck is not really here (hint: DB)    
  • 17. But ruby cannot scale!  Threading in RubyVM is bad  Fibers are way better   I love Jruby      
  • 18. Learn from the best: OpenMP  Standard for parallel processing  Easy to use  Very mature library    
  • 19. OpenMP example  Example #pragma omp parallel for  for (i = 0; i < arraySize; i++){         ....       y[i] = sin( exp( cos( ­ exp( sin(x[i]) ) ) ) );      ....    }    
  • 20. Can we do this in Ruby?  Example for j in 1..30     puts "Hello from iteration " + j.to_s       for i in 0..700000         c += a[i] * b[­i]       end       puts "I have just finished!"  end     
  • 21. In Cuby we trust  Example for j in 1..30     puts "Hello from iteration " + j.to_s       parallel {       for i in 0..700000         c += a[i] * b[­i]       end       puts "I have just finished!"       }      end 
  • 22.   Thank for watching! Questions? Cuby available at:  http://github.com/jonromero/Cuby http://jon.is.emotionull.com jon@emotionull.com