Difference between revisions of "SciRuby"

From Marcotte Lab
Jump to: navigation, search
(Why Ruby?)
(Visualization and Plotting Library)
 
(11 intermediate revisions by one user not shown)
Line 4: Line 4:
  
 
We are not [http://codeforpeople.com/ the first] with this idea, but we want to bring it to life.
 
We are not [http://codeforpeople.com/ the first] with this idea, but we want to bring it to life.
 +
 +
As a further note, we believe that Ruby scripts are no different from the methods used in a mechanical experiment (e.g., the wetlab), and must be published along with any ''published'' derivative experimental results. The license for SciRuby shall likely reflect this, ultimately.
  
 
=== Who We Are ===
 
=== Who We Are ===
Line 21: Line 23:
 
# ''Everything returns a value.'' Ruby's better object model means better of chaining of computation.
 
# ''Everything returns a value.'' Ruby's better object model means better of chaining of computation.
 
# ''Iterators'' are way better than ''for'' loops.
 
# ''Iterators'' are way better than ''for'' loops.
 +
# ''Readability.'' Ruby is incredibly readable, which makes it uber-maintainable.
 
# ''Metaprogramming.'' Sometimes the simplest solution is to write a [http://github.com/wycats/thor code generator]. Sometimes, [http://banisterfiend.wordpress.com/2008/10/06/metaprogramming-in-the-ruby-c-api-part-two-dynamic-methods/ eigenclasses] are the cleanest. <!-- I wish there was a ruby-lang link for this, some sort of official doc (JW) -->
 
# ''Metaprogramming.'' Sometimes the simplest solution is to write a [http://github.com/wycats/thor code generator]. Sometimes, [http://banisterfiend.wordpress.com/2008/10/06/metaprogramming-in-the-ruby-c-api-part-two-dynamic-methods/ eigenclasses] are the cleanest. <!-- I wish there was a ruby-lang link for this, some sort of official doc (JW) -->
 
# ''Integration into Rails.'' The influence of Rails on Ruby is undeniable. Web-based visualization for scientific projects is the future.
 
# ''Integration into Rails.'' The influence of Rails on Ruby is undeniable. Web-based visualization for scientific projects is the future.
 +
# ''R is nice but clunky.'' The learning curve is enormous. It does some things very well, and others not very well at all.
  
 
=== Alternatives and Sources of Inspiration ===
 
=== Alternatives and Sources of Inspiration ===
* [http://github.com/alexgutteridge/rsruby rsruby], [http://rinruby.ddahl.org/ rinruby], [http://github.com/jtprince/simpler simpler]: gems that allow use of R through Ruby.
+
* [http://github.com/alexgutteridge/rsruby rsruby], [http://rinruby.ddahl.org/ rinruby], [http://github.com/jtprince/simpler simpler]: gems which connect Ruby to R
 
* [http://github.com/xdotcommer/flotomatic flotomatic]: Rails gem for the Flot Javascript library, for web data visualization.
 
* [http://github.com/xdotcommer/flotomatic flotomatic]: Rails gem for the Flot Javascript library, for web data visualization.
 
* [http://narray.rubyforge.org/ NArray]: Numerical Ruby NArray and Ruby/PGPLOT.
 
* [http://narray.rubyforge.org/ NArray]: Numerical Ruby NArray and Ruby/PGPLOT.
Line 32: Line 36:
 
== Directives ==
 
== Directives ==
  
=== NArray ===
+
=== Prime Directive ===
 +
 
 +
All published results obtained using our libraries must include online publication of any and all source code using our libraries.
 +
 
 +
=== Numeric Array and Matrix Library ===
 +
 
 +
For what it is worth, the broad success of python is due, in large part, to its numerical computing core, [http://numpy.scipy.org/ numpy].  A few examples: [http://code.google.com/p/h5py/ h5py], [http://www.pymol.org/ pymol], [http://code.google.com/p/mdanalysis/ mdanalysis],...
 +
 
 +
Goals: Stable, robust, fast, extremely well-documented core numerical library.
 +
* FFI (C) or Rice (C++ with Boost)
 +
** Allow for custom C functions with FFI or Rice.
 +
* Good at casting
 +
* Consider [http://docs.scipy.org/doc/numpy/reference/ufuncs.html#broadcasting broadcasting]
 +
* Thoroughly documented, on par with [http://www.yaml.org/YAML_for_ruby.html Yaml Cookbook]
 +
* Convenience wrappers for GSL, perhaps in a separate module.
 +
* Eventual inclusion in Ruby core.
 +
 
 +
NArray is a fantastic library that has served the community for many years.  Can it be extended and better documented, or is it better to start from scratch (borrowing conceptually from NArray where we can) using an FFI or Rice interface?
 +
 
 +
=== Visualization and Plotting Library ===
 +
 
 +
Goals: High-quality, ''interactive'', dynamic visualizations of the sort seen in [http://processing.org/ Processing] and [http://vis.stanford.edu/protovis/ Protovis].
 +
 
 +
Currently, the plan is to build a Ruby DSL for creating Protovis plots. This will allow us to produce a variety of image formats, including SVGs, and make visualization fully realizable on the Web.

Latest revision as of 17:55, 19 November 2010

Contents

The Manifesto

Ruby has no equivalent to the beautifully constructed numpy, scipy, and matplotlib libraries for Python. We believe that the time for a Ruby science and visualization package has come and gone. Sometimes when a solution of sugar and water becomes super-saturated, from it precipitates a pure, delicious, and diabetes-inducing crystal of sweetness, induced by no more than the tap of a finger. So it is, we believe, with the need for numeric and visualization libraries in Ruby.

We are not the first with this idea, but we want to bring it to life.

As a further note, we believe that Ruby scripts are no different from the methods used in a mechanical experiment (e.g., the wetlab), and must be published along with any published derivative experimental results. The license for SciRuby shall likely reflect this, ultimately.

Who We Are

We are Rubyists, lovers of chunky bacon, and scientists. Driven mad by the glee of our Python-loving colleagues, we came together humming Les Mis.

You should join us! Sign up by filling out this form.

Currently, we are:

  • John T. Prince, Department of Chemistry & Biochemistry, Brigham Young University
  • John O. Woods, Marcotte Lab, The University of Texas at Austin

Why Ruby?

First and least, Ruby is a language with a sense of humor.

But more importantly, numerical computation and visualization can be done much better in Ruby, for a number of reasons:

  1. Everything returns a value. Ruby's better object model means better of chaining of computation.
  2. Iterators are way better than for loops.
  3. Readability. Ruby is incredibly readable, which makes it uber-maintainable.
  4. Metaprogramming. Sometimes the simplest solution is to write a code generator. Sometimes, eigenclasses are the cleanest.
  5. Integration into Rails. The influence of Rails on Ruby is undeniable. Web-based visualization for scientific projects is the future.
  6. R is nice but clunky. The learning curve is enormous. It does some things very well, and others not very well at all.

Alternatives and Sources of Inspiration

  • rsruby, rinruby, simpler: gems which connect Ruby to R
  • flotomatic: Rails gem for the Flot Javascript library, for web data visualization.
  • NArray: Numerical Ruby NArray and Ruby/PGPLOT.
  • Ruby GSL: Ruby interface for the GNU Scientific Library

Directives

Prime Directive

All published results obtained using our libraries must include online publication of any and all source code using our libraries.

Numeric Array and Matrix Library

For what it is worth, the broad success of python is due, in large part, to its numerical computing core, numpy. A few examples: h5py, pymol, mdanalysis,...

Goals: Stable, robust, fast, extremely well-documented core numerical library.

  • FFI (C) or Rice (C++ with Boost)
    • Allow for custom C functions with FFI or Rice.
  • Good at casting
  • Consider broadcasting
  • Thoroughly documented, on par with Yaml Cookbook
  • Convenience wrappers for GSL, perhaps in a separate module.
  • Eventual inclusion in Ruby core.

NArray is a fantastic library that has served the community for many years. Can it be extended and better documented, or is it better to start from scratch (borrowing conceptually from NArray where we can) using an FFI or Rice interface?

Visualization and Plotting Library

Goals: High-quality, interactive, dynamic visualizations of the sort seen in Processing and Protovis.

Currently, the plan is to build a Ruby DSL for creating Protovis plots. This will allow us to produce a variety of image formats, including SVGs, and make visualization fully realizable on the Web.