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.


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'
plt = RubyPython.import('matplotlib.pyplot')

plt.ylabel('some numbers');

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.