Forum: Ruby what could be improved in Ruby for Science?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aae5c9f81fe990a48daf2bb91ac82759?d=identicon&s=25 Diego Virasoro (Guest)
on 2009-05-13 15:35
(Received via mailing list)
Hello,
I've noticed that languages such as Python are becoming more and more
fashionable with the Scientific communities, along side more hard core
classics like Fortran and Java.

Do you think  Ruby is missing some piece of technology to be useful in
science? Or poor libraries?
In the end what do you think that could be done to make Ruby more used
in Science?

Diego
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-05-13 16:05
(Received via mailing list)
Diego Virasoro wrote:

> I've noticed that languages such as Python are becoming more and more
> fashionable with the Scientific communities, along side more hard core
> classics like Fortran and Java.

Bioinformatics requires repeatedly shoveling huge blobs of data thru
simple &
not necessarily fast filters. Python (and Perl) scored early adoption
here. They
have nothing, technically, that Ruby doesn't have, including the slow
part.

> Do you think  Ruby is missing some piece of technology to be useful in
> science? Or poor libraries?
> In the end what do you think that could be done to make Ruby more used
> in Science?

All Ruby needs is better libraries, supporting an interacting community
of
practitioners. Everyone needs faster a Ruby, and we have all the same
visualization tools as Python.
Cd0dbf751457cf6fed1f69070d37006a?d=identicon&s=25 Charles Johnson (Guest)
on 2009-05-13 16:40
(Received via mailing list)
On May 13, 2009, at 8:35 AM, Diego Virasoro wrote:

> Hello,
> I've noticed that languages such as Python are becoming more and more
> fashionable with the Scientific communities, along side more hard core
> classics like Fortran and Java.
>
> Diego
>
With the advent of ruby 1.9.1, the only advantage here at ACCRE of
fortran, c and c++ is speed. The multi-threaded, multi-processor,
multi-node jobs that we see could just as easily be done in ruby with
the appropriate library support. However, the fortran libs that do
FFT, say, have been honed over the last 40 years to provide speeds
only slightly slower than code done in assembler. Ruby, java, python
simply do not offer that. That does not mean that ruby could not be
used to *drive* such code. As more and more people in our science
departments discover the advantages of using ruby to access pre-built,
pre-optimized libs the move to using ruby will continue.

Cheers--

Charles
---
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2009-05-13 16:52
(Received via mailing list)
On Wed, May 13, 2009 at 8:35 AM, Diego Virasoro
<Diego.Virasoro@gmail.com> wrote:
> Hello,
> I've noticed that languages such as Python are becoming more and more
> fashionable with the Scientific communities, along side more hard core
> classics like Fortran and Java.
>
> Do you think  Ruby is missing some piece of technology to be useful in
> science? Or poor libraries?
> In the end what do you think that could be done to make Ruby more used
> in Science?

Sounds like personal choice to me.

But for example Matt Wood stated he processes 250TBs of genetics data
per day with Ruby:

http://www.vimeo.com/1104164?pg=embed&sec=1104164

I'm working in genetics research as well, and we're really only using
Rails for our new web dev projects.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-05-13 17:26
(Received via mailing list)
Charles Johnson wrote:

> With the advent of ruby 1.9.1, the only advantage here at ACCRE of
> fortran, c and c++ is speed. The multi-threaded, multi-processor,
> multi-node jobs that we see could just as easily be done in ruby with
> the appropriate library support. However, the fortran libs that do
> FFT, say, have been honed over the last 40 years to provide speeds
> only slightly slower than code done in assembler. Ruby, java, python
> simply do not offer that. That does not mean that ruby could not be
> used to *drive* such code. As more and more people in our science
> departments discover the advantages of using ruby to access pre-built,
> pre-optimized libs the move to using ruby will continue.

That is exactly how videogames work. The lowest layer is custom display
hardware. Above that are drivers that manage huge strings of raw
instructions.

Above that is tuned C++ to manipulate the huge strings. And above that
is a
soft scripting language - typically Lua - to assemble the C++ primitives
into programmable actors who interact in scenarios.

When something is slow, you move it down one layer in the stack. So most
new
programming should happen in Lua, per the rule "premature optimization
is
the root of all evil".
E8a419959139f3f505b49bb95f7e7afe?d=identicon&s=25 Joshua Ballanco (jballanc)
on 2009-05-13 21:53
(Received via mailing list)
On May 13, 2009, at 9:35 AM, Diego Virasoro wrote:

> Hello,
> I've noticed that languages such as Python are becoming more and more
> fashionable with the Scientific communities, along side more hard core
> classics like Fortran and Java.
>
> Do you think  Ruby is missing some piece of technology to be useful in
> science? Or poor libraries?
> In the end what do you think that could be done to make Ruby more used
> in Science?

I have a sneaky suspicion that Ruby is being much more widely used in
Science than you might guess based just on forum posts and Google
searches. I think the biggest difference between science in Python and
science in Ruby is the sharing. For example, I'm using Ruby for some
evolutionary modeling for my Ph.D. thesis. I've thought about library-
izing some of the code, but that's extra effort. In other words, it
seems like Ruby is almost "too good" in that it lets you do really
rapid development of experimental code without the need to first write
entire libraries. The first step in building a better science-ruby
community is remembering to share.

In that respect, let me be the first to post a link to
http://sciruby.codeforpeople.com/
, although it seems to be down (paging Dr. Howard?). Now, there's
another problem in that, as has been mentioned, Python and Perl are
technically no better than Ruby for this sort of work. Of course, the
flip side of that is that Ruby is no better than they are, and they
already have communities with critical mass. So, maybe what Ruby
really needs is to be *better* than Perl and Python.

On that topic, one idea I've been batting around in my head is
extending Ruby's prototyping capabilities and making Ruby methods
first class objects. This would have to either be a Ruby 2.0/2.1 goal,
or a fork of Ruby proper. However, what I imagine is that adding these
two pieces would make Ruby simply unbeatable for all classes of Object
composition patterns of programming (not just scientific programming).

...in my head there's also a graphical representation of Ruby objects
as blocks and methods as slots in the blocks with lots of wires making
logical connections and it's all equally code-able graphically and
textually...

Cheers,

Josh
87ef5d1e14b148eb596433bc17ffe690?d=identicon&s=25 Leo (Guest)
on 2009-05-13 22:34
(Received via mailing list)
> So, maybe what Ruby  
> really needs is to be *better* than Perl and Python.

I'd rather say it needs to be better than a specialized programming
language like R or whatever other language/environment is generally
preferred in your domain of expertise.
5ac9e752df20f6ffeeda61e24eeb3faa?d=identicon&s=25 Steven Hong (Guest)
on 2009-05-14 01:45
(Received via mailing list)
Hi all,

Steven with Manning Publications here. I wanted to let you know that
we've recently published two books on Ruby:

The Well-Grounded Rubyist by David A. Black
The Well-Grounded Rubyist is the thoroughly revised and updated
version of the best-selling Ruby for Rails. David A. Black moves
beyond rails and presents a broader view of Ruby, covering Ruby 1.9,
with the same sharp focus and clear writing that made the first book
stand out.

Ruby in Practice by Jeremy McAnally and Assaf Arkin
For those already familiar with Ruby, Ruby in Practice will take your
productivity to another level, as it is filled with concrete examples
of systems integration, messaging, web development, and databases, all
in a clear problem/solution format.

Until Friday, May 22, you can get either or both books for 40% off at
manning.com with the code "rubytalk40".

Steven Hong
Marketing Coordinator
Manning Publications
www.manning.com
===================
Skype: stevenhong02
Twitter: ManningBooks
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2009-05-14 01:50
(Received via mailing list)
Steven Hong wrote:
> Hi all,
>
> Steven with Manning Publications here. I wanted to let you know that
> we've recently published two books on Ruby:

Thread-hijacking + marketing is not a good mix.
Bc77637b2e39fcd4f3e8a6b61d82a2b5?d=identicon&s=25 jzakiya (Guest)
on 2009-05-14 02:45
(Received via mailing list)
On May 13, 6:50 pm, Joel VanderWerf <vj...@path.berkeley.edu> wrote:
> Steven Hong wrote:
> > Hi all,
>
> > Steven with Manning Publications here. I wanted to let you know that
> > we've recently published two books on Ruby:
>
> Thread-hijacking + marketing is not a good mix.
>
> --
>        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Have a look at the Maya Project (ruby in astrophysics).

http://www.artcompsci.org/kali/five-year-plan3.html
Cec345a59245af9d06e4438a413f4eb5?d=identicon&s=25 Shot (Piotr Szotkowski) (Guest)
on 2009-05-16 13:28
(Received via mailing list)
Joshua Ballanco:

> I have a sneaky suspicion that Ruby is being much more widely used
> in Science than you might guess based just on forum posts and Google
> searches. I think the biggest difference between science in Python
> and science in Ruby is the sharing. For example, I'm using Ruby for
> some evolutionary modeling for my Ph.D. thesis. I've thought about
> library-izing some of the code, but that's extra effort. In other
> words, it seems like Ruby is almost "too good" in that it lets you
> do really rapid development of experimental code without the need
> to first write entire libraries. The first step in building a better
> science-ruby community is remembering to share.

Hear, hear. I use Ruby for my PhD as well (functional decomposition
of FSMs for implementation in FPGAs), and am just rewriting¹ my first
version from scratch (targetting Ruby 1.9 along the way). I do try to
have a fat library with just a thin ‘executable’ around it, but getting
it working first is more important than getting it reusable outright
(I also don’t see that much use for it outside of my PhD, but I might
be wrong here).

¹ http://github.com/Chastell/art-decomp

> In that respect, let me be the first to post a link to
> http://sciruby.codeforpeople.com/, although it seems to
> be down (paging Dr. Howard?).

Sadly, there also aren’t any files at the relevant RubyForge page.

— Shot
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2009-05-16 14:26
(Received via mailing list)
On Wed, May 13, 2009 at 9:52 PM, Joshua Ballanco <jballanc@gmail.com>
wrote:
>> in Science?
>
> In that respect, let me be the first to post a link to
> http://sciruby.codeforpeople.com/, although it seems to be down (paging Dr.
> Howard?). Now, there's another problem in that, as has been mentioned,
> Python and Perl are technically no better than Ruby for this sort of work.
> Of course, the flip side of that is that Ruby is no better than they are,
you must be kidding here ;) No it is me who's kidding, let me try to
explain please:

Ruby has qualities Perl and Python can only dream of, and Perl and
Python have some that elude me, I admit.
However I guess that most people on this list share the view that Ruby
just is better for most jobs.

I guess that, and you see I do take your statement very seriously that
it would be "our" job to pass this message on. Hmm maybe we need,
"What Ruby (and only Ruby) can do for you" blog :).
> and they already have communities with critical mass. So, maybe what Ruby
> really needs is to be *better* than Perl and Python.
I
>
> On that topic, one idea I've been batting around in my head is extending
> Ruby's prototyping capabilities and making Ruby methods first class objects.
Hmm this seems to recur today What about traits or prototypes with
behavior.
Apart of potential performance (but who cares at design time) I do not
see any problem not to use methods anymore but only lambdas (Ruby1.9
that is, 1.8 seems too much pain for that IMHO). Actually I have
blogged about that quite some time ago (I am not going to link to my
blog twice a day, that would be very bad taste indeed).
Ruby-traits do that already and PPP could easily be extended that way.
However the question that remains is, are lambdas objects enough?
I mean, would we like to do things as:

   l = lambda{ |y| x+=1; y *x }
   l.code  => '???'
   l.bytecodes =>
   l.insert_code_after

or simply have complete control of the bytecode in a respective way,
am I getting OT again?

> This would have to either be a Ruby 2.0/2.1 goal, or a fork of Ruby proper.
> However, what I imagine is that adding these two pieces would make Ruby
> simply unbeatable for all classes of Object composition patterns of
> programming (not just scientific programming).
Like AOP
Robert
--
Toutes les grandes personnes ont d’abord été des enfants, mais peu
d’entre elles s’en souviennent.

All adults have been children first, but not many remember.

[Antoine de Saint-Exupéry]
E8a419959139f3f505b49bb95f7e7afe?d=identicon&s=25 Joshua Ballanco (jballanc)
on 2009-05-17 17:28
(Received via mailing list)
On May 16, 2009, at 8:26 AM, Robert Dober wrote:

> Ruby has qualities Perl and Python can only dream of, and Perl and
> Python have some that elude me, I admit.
> However I guess that most people on this list share the view that Ruby
> just is better for most jobs.
>
> I guess that, and you see I do take your statement very seriously that
> it would be "our" job to pass this message on. Hmm maybe we need,
> "What Ruby (and only Ruby) can do for you" blog :).

There's an old adage in software development (or, as old as an adage
about a 50 year old profession can be) that if the customer does not
know about a feature of your program, then that feature doesn't exist!
I agree that Ruby has many strengths over Perl and Python for
scientific programming. If I didn't, I wouldn't be using it. However,
the strengths don't quite align with how I think most scientists
approach computing. That is, Ruby is a beautiful language. Call it a
Katana, beautifully crafted with patience and care and decorated with
ancient symbols of strength and power. Now, the average scientific
programmer is approaching the problem as if it were meat to be
chopped, so they reach past the Katana in your outstretched hand for
the dirty, dull, and nicked meat cleaver.

In other words, it's not that scientific programming _can't_ take
advantage of Ruby's enhanced abilities, it's that they _don't_. I
think an "Annie Oakley" blog would be a great idea ("Anything you can
do I can do better")! Unfortunately, (ironically, even) I don't have
the time to run such a blog. However, if somebody wanted to set
something like that up, I'd be happy to participate. Maybe the guys
over at the "Ruby Best Practices" blog would be interested?

As for my suggestions about prototype inheritance and first-class
functions (and I believe that I'm probably the only one making much
noise about this recently), let me explain quickly: I'm doing
evolutionary modeling. The basic idea is to represent cells, and what
those cells can do, in Ruby code. Now, I could (and very well might)
write a DSL for the problem space. If Ruby had prototype based
inheritance and first-class functions, on the other hand, a DSL
wouldn't be needed as objects could sub in for evolving cells.

So, it's not just the classic compositional patterns that would be
easier to implement, but fun new paradigms that could be approached
using Ruby in new ways too...

...just thoughts...use them as you see fit

- Josh
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2009-05-17 18:13
(Received via mailing list)
On Sun, May 17, 2009 at 5:25 PM, Joshua Ballanco <jballanc@gmail.com>
wrote:

> the dirty, dull, and nicked meat cleaver.
Hmm I am a very lazy guy and I never could become friends with Python
because it was just standing in my way. ( Perl was not, however :)
> In other words, it's not that scientific programming _can't_ take advantage
> of Ruby's enhanced abilities, it's that they _don't_. I think an "Annie
> Oakley" blog would be a great idea ("Anything you can do I can do better")!
> Unfortunately, (ironically, even) I don't have the time to run such a blog.
> However, if somebody wanted to set something like that up, I'd be happy to
> participate. Maybe the guys over at the "Ruby Best Practices" blog would be
> interested?
This is truly a great idea, however I somehow tend to disagree with
your assessment about the needs to see Ruby's full powers to
appreciate it.
To put it constructive: Whatever you can do, I can do "simpler"!
This is a challenge I really would like to take :)
>
> As for my suggestions about prototype inheritance and first-class functions
> (and I believe that I'm probably the only one making much noise about this
> recently)
it is almost sure now, *nobody* reads my blog, but let us see...
> ...just thoughts...use them as you see fit
Oh I will ;) I find them fascinating, maybe we need something like a
very high level bytecode, I have already registered a Rubyforge
project for this but lost speed. My idea was to serialize methods and
send them to a remote vm to be executed there (potentially with URL
based closures and maybe even a network based local variable lookup ).
I always wondered what might happen if a "send :+" mutates to a "send
:-" ;).
Seriously I will try to give this some more thought about how lambdas
could be "modified", I guess composition is the first idea that comes
into mind.

Cheers
Robert
--
Toutes les grandes personnes ont d’abord été des enfants, mais peu
d’entre elles s’en souviennent.

All adults have been children first, but not many remember.

[Antoine de Saint-Exupéry]
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Thomas Sawyer (7rans)
on 2009-05-18 15:42
(Received via mailing list)
On May 13, 9:35 am, Diego Virasoro <Diego.Viras...@gmail.com> wrote:

> In the end what do you think that could be done to make Ruby more used
> in Science?

Help improve <a href="http://stick.rubyforge.org">Stick</a>.
01cd7a5d8751789819701518f3fe6ffa?d=identicon&s=25 Juan Zanos (Guest)
on 2009-05-18 21:11
(Received via mailing list)
On May 13, 2009, at 9:35 AM, Diego Virasoro wrote:

> Diego
>

In order to learn anything you have to give up hope of learning
everything.
Most of the scientific community I work with has chosen not to learn
much about
software languages and tools citing the hope (or convenient fiction)
that none
of that matters.  Some will confide that tools might make a difference
but it's
too much of a time synch to really examine the problem.  Scientists are
interested in their fields more than software.

Right now there are few scientific libraries for Ruby and the ones
that exist
often lack polish, are difficult to contribute to, and are difficult
to install
and setup.  In comparision, a lot of the more Internet oriented Ruby
libraries
are well tested, available as easy to install gems, ported to work on
lots of
Ruby VMs, and available on modern distributed version control systems
making
contributions, maintenance, and sharing much easier.

Possibly there is a window of opportunity during which Ruby solutions
will be
adopted if they are sufficiently available.  I don't think it would
take that much
time, effort, and money to make Ruby's scientific libraries a lot more
compelling
than they are now.
321492ebcf7d831c99243830690bfaa7?d=identicon&s=25 justin caratzas (Guest)
on 2009-05-18 21:20
(Received via mailing list)
On Mon, May 18, 2009 at 3:08 PM, Juan Zanos
<juan_zanos@talkhouse.com>wrote:

>> In the end what do you think that could be done to make Ruby more used
> of that matters.  Some will confide that tools might make a difference but
> it's
> too much of a time synch to really examine the problem.  Scientists are


you mean time sink?  If the scientists were able to perform a time
synch,
then they could learn everything about everything.  That'd be awesome.


>
> interested in their fields more than software.
>
> Right now there are few scientific libraries for Ruby and the ones that
> exist
> often lack polish, are difficult to contribute to, and are difficult to
> install
> and setup.  In comparision, a lot of the more Internet oriented Ruby
> libraries
E8a419959139f3f505b49bb95f7e7afe?d=identicon&s=25 Joshua Ballanco (jballanc)
on 2009-05-18 21:28
(Received via mailing list)
On May 18, 2009, at 3:08 PM, Juan Zanos wrote:

>> in
> Most of the scientific community I work with has chosen not to learn
> that exist
> Possibly there is a window of opportunity during which Ruby
> solutions will be
> adopted if they are sufficiently available.  I don't think it would
> take that much
> time, effort, and money to make Ruby's scientific libraries a lot
> more compelling
> than they are now.
>


So let's do something about that then, eh?

- Josh
01cd7a5d8751789819701518f3fe6ffa?d=identicon&s=25 Juan Zanos (Guest)
on 2009-05-18 22:43
(Received via mailing list)
On May 18, 2009, at 3:26 PM, Joshua Ballanco wrote:

>>> core
>>>
>> are
>> Ruby VMs, and available on modern distributed version control
>>
>
>
> So let's do something about that then, eh?
>
> - Josh
>

That was fast.
E8a419959139f3f505b49bb95f7e7afe?d=identicon&s=25 Joshua Ballanco (jballanc)
on 2009-05-19 01:50
(Received via mailing list)
On May 18, 2009, at 9:39 AM, trans wrote:

>
>
> On May 13, 9:35 am, Diego Virasoro <Diego.Viras...@gmail.com> wrote:
>
>> In the end what do you think that could be done to make Ruby more
>> used
>> in Science?
>
> Help improve <a href="http://stick.rubyforge.org">Stick</a>.
>

Is there a GitHub repo/mirror of this project? I'd love to add this to
RubyScience, but (at least for the time being) I'm trying to limit
that to GitHub projects.

- Josh
This topic is locked and can not be replied to.