Skip to content

GSOC 2014: Ruby Notebook

Daniel Mendler edited this page Feb 27, 2014 · 1 revision

Disclaimer: First draft, still work in progress

Mentor: Daniel Mendler (@minad), Anna Belak (@aabelak), Alex Emly

Ruby needs a science notebook with integrated plotting. Two examples of such pieces of software are IPython notebook and Mathematica. There already exists a prototypical Ruby kernel for IPython which this project could be based upon.

Ruby already has useful plotting tools, including Plotrb (GSoC 2013 by Wan Zuhao) and Rubyvis. Both produce publication-quality graphics. Integration of the graphics in an interactive notebook would be a very powerful tool for researchers. Work on a Ruby notebook might also necessitate development or extension of some plotting software.

As a backend for the project we suggest IPython which is currently opening up to support more languages which is already shown by the IRuby or IJulia kernels. However there is still a lot of improvement also on the IPython backend.

Goals of the project

  • Improve integration with IPython, work with the IPython developers to improve the support for multiple languages.
  • Extend the IPython Ruby kernel in such a way that different languages can be used in the notebook (Similar to IPython magics). This would open up a whole world of possibilities (access to computer algebra systems like octave/maxima, statistical language R, etc.). Scientific work usually involves a lot of different tools. We want to take the pragmatic approach and enable the use of existing tools in a Ruby environment.
  • Improve the plotting support and integrate nicely with the existing SciRuby libraries.
  • Improve the general user experience and ensure that a bundle of SciRuby libraries + IRuby can be easily installed, to get new users quickly started.

The technical aspects are probably very interesting and promise fast progress. However very important is also the general user experience and the better integration with existing scientific tools. A functional Ruby notebook with rich features could draw attention to the SciRuby project and also Ruby in general as a powerful language for scientific computing.

Architecture

The IPython architecture is a client server architecture where the evaluating kernel is connected to the frontend by the 0MQ protocol. The current IRuby kernel implements this protocol partially.

Multi language support via a super-kernel

For the multi-language integration it would probably make sense to create a super-kernel which performs dispatching to subkernels where each kernel handles one language. @minad proposed such a multi-language architecture at https://github.com/ipython/ipython/issues/4386. The IPython kernel implements multi-languages currently by itself (IPython magics), so maybe we could reuse it or use it as subkernel. The IJulia team decided not to support other languages in their current iteration.

                                   /---0mq---> IPython kernel
Frontend <---0mq---> Super-Kernel <---0mq----> Ruby kernel
                                   \---0mq---> Maxima kernel, R kernel, ...

Variable passing between different kernels

In a multi-kernel architecture we would obviously have the need to pass variables between the different kernels. For that we would probably have to extend the IPython protocol by which the super-kernel talks to the underlying sub-kernels.

Plotting

A key goal of the Ruby notebook is improved plotting. You should expect to focus heavily on getting some kind of plotting software working in the notebook — whether that means gnuplot, Rubyvis, Plotrb, or even R. Check out the projects on the main Ideas page that relate to plotting for some more information.

Integration with external tools/frameworks

It would be very nice to find ways to integrate Sciruby with other frameworks. The notebook is a single point where multiple systems can come together. Take a look at External software for a list of other open source projects.

Brainstorming by @minad

Getting Ruby more usable for science is the general goal. I think the best progress can be made by using the existing great tools. We all love and create open source for exactly that reason. @minad also played a bit with Python <-> Ruby bridges which could integrate the worlds much better. However this might be very much out of the scope of this project. There are also great technical difficulties standing in the way, e.g. the many different Ruby and Python interpreters and their different APIs.

Clone this wiki locally