Polyglot Bridges

Created 2015-06-14 / Edited 2015-10-18

Tags: Polyglot, Ruby, Perl6, Python

Here are the slides for Polyglot Bridges (pdf) lightning talk that I gave today at RubyNation.

slideshare:www.slideshare.net/awwaiid/mad-science-a-dash-of-polyglot

The most important bit:

# Shell
sudo apt-get install matplotlib
gem install rubypython
# pending a small patch for debian/ubuntu 64bit

# Ruby; even works in the REPL!
require 'rubypython'
RubyPython.start
plt = RubyPython.import('matplotlib.pyplot')

plt.plot([1,2,4,6,28,50,234])
plt.ylabel('some numbers');
plt.show

Or in other words: pull in this rubypython gem, magically get all the python libs callable from Ruby. In this case, you get all the nice charts and graphs from pyplot. I originally played with this in Perl6/Rakudo Inline::Python, where it also works fantastically.

I love the idea of one community NOT completely re-writing a library in their language when it can just be used "directly" instead.