Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Mad Science:
Polyglot Bridges
RubyNation 2015
Brock Wilcox
awwaiid@thelackthereof.org
"or using" ... hmmm
JVM
Java
JRuby
Scala
Clojure
Javascript
Opal
CoffeeScript
ClojureScript
C
Libraries
Languages!
Use case: graph some stuff from Perl6/Rakudo
> sudo apt-get install matplotlib
# Python
import matplotlib.pyplot as plt
panda install Inline::Python
Perl6 (Rakudo) → Python
Ruby?
gem install rubypython # !!!
(small patch to fix lib)
Ruby (YARV) → Python
FFI... so sweet!
Ruby (JVM) → Python
Also works!
Exercise for the reader:
Pick a model. Visualize it!
require 'rubypython'
RubyPython.start
plt = RubyPython.import('matplotlib.pyplot')
# The 'left' slices it down to year-mon...
THE END
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Mad Science: Polyglot Bridges
Upcoming SlideShare
Loading in …5
×

Mad Science: Polyglot Bridges

4,240 views

Published on

Talking about calling one language from another.... sort of embedding them inside each other. Code reuse at its finest?

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Mad Science: Polyglot Bridges

  1. 1. Mad Science: Polyglot Bridges RubyNation 2015 Brock Wilcox awwaiid@thelackthereof.org
  2. 2. "or using" ... hmmm
  3. 3. JVM Java JRuby Scala Clojure
  4. 4. Javascript Opal CoffeeScript ClojureScript
  5. 5. C
  6. 6. Libraries
  7. 7. Languages!
  8. 8. Use case: graph some stuff from Perl6/Rakudo
  9. 9. > sudo apt-get install matplotlib # Python import matplotlib.pyplot as plt
  10. 10. panda install Inline::Python Perl6 (Rakudo) → Python
  11. 11. Ruby?
  12. 12. gem install rubypython # !!! (small patch to fix lib) Ruby (YARV) → Python
  13. 13. FFI... so sweet!
  14. 14. Ruby (JVM) → Python
  15. 15. Also works!
  16. 16. Exercise for the reader: Pick a model. Visualize it!
  17. 17. require 'rubypython' RubyPython.start plt = RubyPython.import('matplotlib.pyplot') # The 'left' slices it down to year-month order_counts = Order .group("left(created_at, 7)") .count .values plt.plot(order_counts) plt.show
  18. 18. THE END

×