Re: ed borasky and his second favourite programming language

Thank you, Paul, for the link.
Assuming that Ara’s link to Ed Borasky’s opinions also makes the case
for R,
I’ve two questions:

obviously, you can like features of R very much, but what do you do
if the code you have to write doesn’t have anything to do with
statistics?
What are the nice features of R that make it superior to Ruby in Ed
Borasky’s opinion - and do we agree with him ?

Ruby is “more general” than R (since there are bindings for R
available),
and there are also bindings to other scientific programs/packages e.g.,
GSL
(if you want to to do numerical integration or random number
generation).

I think one should compare languages that do about the same things
with respect to how they do it.

Best regards,

Axel

On Jul 4, 2006, at 17:03, [email protected] wrote:

Thank you, Paul, for the link.
Assuming that Ara’s link to Ed Borasky’s opinions also makes the
case for R,
I’ve two questions:

obviously, you can like features of R very much, but what do you do
if the code you have to write doesn’t have anything to do with
statistics?

Presumably, if you don’t just use R, you use your second-favourite
language. You’re allowed to use more than one, you know.

What are the nice features of R that make it superior to Ruby in Ed
Borasky’s opinion - and do we agree with him ?

I can’t speak for Ed, but for me (I use it as well), it does
precisely what it needs to do, and it does it succinctly and well.
Which, not coincidentally, are the same reasons I use Ruby for the
things I use Ruby for, and the same reasons I use Prolog for the
things I use Prolog for.

Ruby is “more general” than R (since there are bindings for R
available),
and there are also bindings to other scientific programs/packages
e.g., GSL
(if you want to to do numerical integration or random number
generation).

But what does this statement mean? Simply being “more
general” (which I’ll just accept for now, even though the definition
seems a little wishy-washy) doesn’t get you anywhere. Being better
at particular tasks is what wins.

I think one should compare languages that do about the same things
with respect to how they do it.

That might be interesting for its own sake, but it doesn’t really
teach us anything about the languages being compared. Languages are
just tools, and not all tools are meant to do the same things. This
one drives nails, this one turns screws, this one calculates
eigenvectors, and this one makes foxes eat bacon. Knowing those
aspects of a language are much more valuable than, say, knowing which
one is faster at a ‘hello world’ web application.

matthew smillie.

Matthew S. wrote:

On Jul 4, 2006, at 17:03, [email protected] wrote:

Thank you, Paul, for the link.
Assuming that Ara’s link to Ed Borasky’s opinions also makes the case
for R,
I’ve two questions:

obviously, you can like features of R very much, but what do you do
if the code you have to write doesn’t have anything to do with
statistics?
Let me put a little context on this. At the time I adopted R, the
project I was working on was written nearly 100 percent in Perl, and
most of that was Perl 4 code I had hand-translated from some primitive
“awk” scripts. The need arose to create some statistical graphs
(boxplots mostly) and other late 20th century artifacts.

So I went hunting for an open-source tool that would do that. The
requirements, other than open source and the ability to do the graphs,
was that the package be able to run on either Windows or Linux, and that
it be “accessible from Perl” in some sense. A nice-to-have was that it
could be found on Red Hat media (7.0 IIRC).

There were three candidates: Perl Data Language (PDL), XLisp-Stat, and
R. PDL is mainly for image processing, and I didn’t see boxplots built
in, so it dropped out first. I personally didn’t have any problem
programming in Lisp, but I wasn’t willing to saddle my colleagues with
the task of learning Lisp, and the R community looked larger and more
vibrant than the XLisp-Stat community. So R won out.

My current modus operandi is to do the data crunching in Perl, a task
for which it was designed, and upload the data into a relational
database or CSV files, then do the analysis in R. If I were writing all
of this magic over today, I’d probably build a Rails app and use the R
math library for the analysis.

Now, to answer the question: “but what do you do
if the code you have to write doesn’t have anything to do with
statistics?”

Well, first of all, being a mathematician, I’ll make the claim that
any sufficiently large task, programming or otherwise, has some
statistics in it. :). Second, if the task is mostly statistics and
graphics but contains other elements, like the need for a GUI, database
interface, web serving, regular expression handling – in short, all the
things we use “scripting languages” like Ruby as our primary tools to
accomplish – you don’t need to leave R! There are libraries (now) that
do all of these things.

What are the nice features of R that make it superior to Ruby in Ed
Borasky’s opinion - and do we agree with him ?
Clearly R is superior to Ruby for executing the 700-odd packages in the
CRAN, Bioconductor and OmegaHat repositories. :slight_smile: If you read through
that list, you’ll find a lot of things that R does very well that you
probably never heard of. Of the 700-odd packages, I regularly use
perhaps five or ten – the kernel smoothers, the database interfaces,
the GUI and web servers and occasionally the time series packages.

And clearly Ruby is superior to R for lots of things. They don’t happen
to be things I get paid to do at the moment. They are things I want to
learn how to do, which is why I’m learning Ruby. Ruby is, as far as I
can tell, the best-designed general purpose language to date.

I can’t speak for Ed, but for me (I use it as well), it does precisely
what it needs to do, and it does it succinctly and well. Which, not
coincidentally, are the same reasons I use Ruby for the things I use
Ruby for, and the same reasons I use Prolog for the things I use
Prolog for.
I attempted to learn Prolog once. I never got very far with it, and
moved on to FORTH. :slight_smile:

Ruby is “more general” than R (since there are bindings for R
available),
and there are also bindings to other scientific programs/packages
e.g., GSL
(if you want to to do numerical integration or random number
generation).
I think R has bindings for GSL too – about the only thing I don’t
recall R being able to do is call Ruby. :slight_smile:

I think one should compare languages that do about the same things
with respect to how they do it.
That might be interesting for its own sake, but it doesn’t really
teach us anything about the languages being compared. Languages are
just tools, and not all tools are meant to do the same things. This
one drives nails, this one turns screws, this one calculates
eigenvectors, and this one makes foxes eat bacon. Knowing those
aspects of a language are much more valuable than, say, knowing which
one is faster at a ‘hello world’ web application.
Yeah, but … when C first came out, it was touted as a general-purpose
language, which indeed it is. About the only people who didn’t jump on
the C bandwagon were the AI folks, who were married to Lisp, and the
number crunchers, who were married to FORTRAN. C for all practical
purposes wiped out assembler, PL/I, Ada, Pascal, and even COBOL.

Today, C drives nails, turns screws, calculates eigenvectors, and powers
Linux, GCC, Perl, Python, PHP, R and Ruby. I’ve never heard of a FORTRAN
compiler written in FORTRAN. But … Lisp and Scheme for the most part
still power (and compile) themselves. :slight_smile:


M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

Phil T. wrote:

example.
Useful, sure … as fast as, as well supported by “professional
statisticians” … that I rather doubt. Languages – both human and
programming – co-evolve within a community of creators and users. R
co-evolved in a community of statisticians with a highly numerical
approach. Maxima co-evolved in a community of scientists with lots of
symbolic math to do, mostly having to do with the physics of nuclear
energy. It’s pretty clear to me that Rails co-evolved in a community of
web application designers and users, but I’m not sure about Ruby – I’m
a latecomer to Ruby.

compare data from other research in your own paper. crazy idea?
Couldn’t a mashup of web programming and sci-research-languages lead
to a new level of collaboration?
Could … and … (pregnant pause) has. Donald Knuth calls this
“literate programming.” In the Python universe, it’s well supported by
Ed Ream’s “Leo” editor
(http://webpages.charter.net/edreamleo/front.html). R has literate
programming “built in” using something called “SWeave”. See

http://www.bepress.com/bioconductor/paper2

for some pointers. I have quite a few links stashed away on literate
programming, mostly in R. I haven’t taken the time to do a search for
literate programming in the Ruby context, but I’m sure it’s there.

something like a wiki so that the research continues to grow on one
site? That could certainly lead to a new level of collaboration.
Axiom is another language that’s heavily into literate programming and
in fact has a wiki as its main portal.

http://wiki.axiom-developer.org/FrontPage

…just brainstorming…
Amazing, isn’t it? “Not even the tread of mighty armies can stop an idea
whose time has come.” :slight_smile:


M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

On 7/4/06, M. Edward (Ed) Borasky [email protected] wrote:

using Ruby that could be every bit as useful as R for statistics, for

them and access the underlying data? It would make it easy to then
compare data from other research in your own paper. crazy idea?
Couldn’t a mashup of web programming and sci-research-languages lead
to a new level of collaboration?
Could … and … (pregnant pause) has. Donald Knuth calls this
“literate programming.”

I’ve heard of literate programming and I’m not quite sure if that’s
what I’m thinking about… it might be part of the picture, but not
the whole.

In the Python universe, it’s well supported by
Ed Ream’s “Leo” editor
(http://webpages.charter.net/edreamleo/front.html). R has literate
programming “built in” using something called “SWeave”. See

http://www.bepress.com/bioconductor/paper2

This second link seems to be closer to what I’m thinking.

Ed: do you happen to live in the Portland Oregon area? I’m guessing
you do based on your choice of beers and the radio station listed on
your home page. If so there’s a PDX.rb meeting coming up at FreeGeek
this Thursday evening at 7PM.

Phil

On Jul 4, 2006, at 9:47 AM, Matthew S. wrote:

general" (which I’ll just accept for now, even though the
definition seems a little wishy-washy) doesn’t get you anywhere.
Being better at particular tasks is what wins.

For small, well-defined problems that won’t change, a specialised
language is best, if there is an appropriate one.

For large, well-defined specialised problems that won’t change, a
specialised language is best.

For most projects, we don’t know if the specs will change, if we even
have detailed specs in the first place. In this case when it’s
important to be able to deal with unpredictable challenges, a more
general language is important.

R can get us to one place. Ruby can get us anywhere, a bit slower(?).
If we’re not positive where we’re going, then Ruby is a good idea.

I have nothing against R, but it’s not true that being better at
particular tasks always, or even usually, wins. Even if Ruby is not
the best at any particular tasks it could still frequently be the
best choice for projects.

– Elliot T.

On 7/4/06, Matthew S. [email protected] wrote:

things I use Prolog for.
seems a little wishy-washy) doesn’t get you anywhere. Being better
at particular tasks is what wins.

I’ve never used R however I’m sure it’s just great for statistics and
perhaps some other mathemtaical operations. I’m all for using the
right tool for the right job and all that…

However, having some experience with creating DSLs for describing and
simulating quantum circuits [QDL] and for RTL/behavioral level
description/simulation [RHDL], Ihave the suspicion that Ruby is
flexible enough such that we could create some domain specific
languages with it (where the domains can be science and math). It
would be cool to create several little specialized languages in Ruby
so that we could have the ‘best of both worlds’ - good for specialized
domains while also being good at solving general propgramming
problems. One can imagine that we could create a specialized language
using Ruby that could be every bit as useful as R for statistics, for
example.

Also, one can imagine that we could perhaps create something very new
given Ruby’s strengths right now (Rails and web programming in
general): The web-enabled research paper. When I was working on my
master’s thesis I kept thinking that it would be great if I could not
only read the reference papers, but also access their experimental
data seamlessly. And perhaps not only the data , but also the
programs used to generate that data. What if graphs in a web-enabled
research paper were not just graphs, but you could also ‘push-into’
them and access the underlying data? It would make it easy to then
compare data from other research in your own paper. crazy idea?
Couldn’t a mashup of web programming and sci-research-languages lead
to a new level of collaboration?

For example: my master’s thesis is up on the web in a pdf. A couple
of weeks ago someone doing similar research sent me some questions
about it and asked for more info. What if instead of a static pdf, my
thesis was a web app? The person who was sending the inquiry could
have clicked on the graph in question and downloaded the data used to
create the graph as well as the program used to create the data. They
could have then gone on to modify the algorithm used in the program
somewhat to test their theory and then ‘publish’ the results back to
the web app (or perhaps post their own web app). Maybe it would work
something like a wiki so that the research continues to grow on one
site? That could certainly lead to a new level of collaboration.

…just brainstorming…

Phil

Elliot T. wrote:

For small, well-defined problems that won’t change, a specialised
language is best, if there is an appropriate one.

For large, well-defined specialised problems that won’t change, a
specialised language is best.
Yes … as I noted in an earlier post, C did not manage to displace
either FORTRAN or Lisp. Both FORTRAN and Lisp are in a sense general
purpose, but they got “tuned” for specific application areas – number
crunching for FORTRAN and AI for Lisp. And the only languages that have
risen up since C that have given it a serious challenge are the
scripting languages Perl, Python and Ruby, and to a lesser extent Java.
For most projects, we don’t know if the specs will change, if we even
have detailed specs in the first place. In this case when it’s
important to be able to deal with unpredictable challenges, a more
general language is important.
Agreed … though I suspect something very much higher level than a
“typical” programming language is really what’s required for this type
of project. UML, for example, or the new tools that are starting to come
along based on the “PI Calculus”.
R can get us to one place. Ruby can get us anywhere, a bit slower(?).
If we’re not positive where we’re going, then Ruby is a good idea.
Hmmm … was it the caterpillar or the Cheshire cat who told Alice,
“Well, if you don’t know where you want to go, any road will take you
there?”


M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs