This is an IPython notebook, backed by a ruby kernel.

I wrote a kernel in Ruby that adheres to the IPython messaging protocol. Then I modified IPython, with the help of minrk from #ipython, to instantiate my Ruby Kernel instead of its own Python kernel.

The IPython KernelManager start the RubyKernel as a subprocess, and from that point communication occurs over ZeroMQ, exactly as if it were IPython’s own kernel.

Once that is done, it’s easy to execute ruby against that kernel right in the browser.

This kernel was started with:

ipython kernel --KernelManager.kernel_cmd="['ruby', './lib/kernel.rb', '{connection_file}']" --Session.key=''

That’s all the configuration necessary to get the Ruby kernel running

(requires minrk’s branch of iruby kernel, and gems ffi-rzmq and uuid)

In [9]:
class Neat
  def eh?
    puts "hell yes it is."
  end
end

Neat.new.eh?
hell yes it is.
Out[9]:
[]

I wrote a kernel in Ruby that adheres to the IPython messaging protocol. Then I modified IPython, with the help of minrk from #ipython, to instantiate my Ruby Kernel instead of its own Python kernel.

The IPython KernelManager start the RubyKernel as a subprocess, and from that point communication occurs over ZeroMQ, exactly as if it were IPython’s own kernel.

Once that is done, it’s easy to execute ruby against that kernel right in the browser.

This kernel was started with:

ipython kernel --KernelManager.kernel_cmd="['ruby', './lib/kernel.rb', '{connection_file}']" --Session.key=''

That’s all the configuration necessary to get the Ruby kernel running

(requires minrk’s branch of iruby kernel, and gems ffi-rzmq and uuid)

In [9]:
class Neat
  def eh?
    puts "hell yes it is."
  end
end

Neat.new.eh?
hell yes it is.
Out[9]:
[]

Similar Notebooks

 

 

Leave a comment

Your email address will not be published. Required fields are marked *