Is ruby is faster than all Object oriented Scripting langs

B

bramu.ss

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application..

Thanks,
Ramu.
 
7

7stud --

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application..

Thanks,
Ramu.

Ruby is the slowest executing of all scripting languages. I suggest you
go with python. I've studied both languages and I prefer python.
 
I

Iñaki Baz Castillo

El S=C3=A1bado, 29 de Marzo de 2008, 7stud -- escribi=C3=B3:
Ruby is the slowest executing of all scripting languages. I suggest you
go with python. I've studied both languages and I prefer python.

Maybe with YARV virtual machine (integrated in Ruby since 1.9.1 AFAIK) will=
=20
Ruby faster?

=2D-=20
I=C3=B1aki Baz Castillo
 
M

Mark Woodward

Hi 7Stud,

... I've studied both languages and I prefer python.

thems fight'n words ;-)
Just out of curiosity though what makes you prefer Python?
I'm looking into both myself, so i'd appreciate your opinion.


cheers,
 
J

James Gray

Ruby is the slowest executing of all scripting languages.

That's an amazing bold claim I would never be brave enough to make.
I'm sure we all know Ruby is not as fast as many languages, but anyone
who has studied programming at all knows fundamental truths like:

* The algorithm counts far more than the language when optimizing for
speed
* Speed should be a late concern in most projects
* It's generally pretty easy to optimize the 10% of the code where
speed is actually critical, even if you need to drop down to something
like C for just that part

I have little doubt that we could find some Python code slower than
equivalent Ruby projects, just as I'm sure we could find some code to
support your claim. I think the key is just to avoid this kind of one-
dimensional thinking in the first place though.

If your going to choose Python because you think it's faster, I have a
better recommendation: write down all the languages you can think of,
close your eyes, and point. It's the same (or possibly better)
selection criteria.

Besides we all know C and OCaml smoke Python in speed. ;)

James Edward Gray II
 
M

Mark Ryall

[Note: parts of this message were removed to make it a legal post.]

It does seem a somewhat inflammatory statement to make on this list.

Clearly it is a completely subjective argument but i think if you want
incredible performance, C is a pretty good option but if you want to enjoy
writing code and produce code so beautiful that it will make your
grandchildren weep for joy, ruby is the best currently available option.

I guess some grandchildren will argue that the poignancy of python makes
them weep with more joy but i'd think they were in the minority. This would
be an easily measured and incredibly useful statistic.
 
M

M. Edward (Ed) Borasky

Mark said:
It does seem a somewhat inflammatory statement to make on this list.

Clearly it is a completely subjective argument but i think if you want
incredible performance, C is a pretty good option but if you want to enjoy
writing code and produce code so beautiful that it will make your
grandchildren weep for joy, ruby is the best currently available option.

Well ... I beg to differ. If you actually read _Beautiful Code_, you
will see beautiful code in many languages ... even Fortran, IIRC.
 
C

Casey Hawthorne

Benchmarks depend on the application you are testing against.

What kind of application are you doing?

Have you looked at Groovy?
 
A

ara.t.howard

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application..

learn them both.

the speed will depend entirely on the application - for instance there
are c-bindings for many libraries in both python and ruby. if the
binding exists for one but not the other your application will be
faster in that one. frankly, if you are learning either one for
'speed' you've got real troubles - both are 100/10000 time slower than
pure c for cpu intensive tasks. we write ruby because it makes our
minds stop hurting and because it let's solve problems that we would
not be able to comprehend in other languages, and therefore which
would remain unsolved. python is quite good with regard to this too.

technically speaking you don't really learn a 'language' - you learn
an implementation of a turning machine and use it to solve problems.
the choice if implementation should be determined by

a) what you like.

b) what you require.

i order them that way because very little code gets written when you
hate what you are doing.

kind regards.

a @ http://codeforpeople.com/
 
M

M. Edward (Ed) Borasky

Casey said:
Benchmarks depend on the application you are testing against.

What kind of application are you doing?

Have you looked at Groovy?

The last time I looked (November 2007) Groovy was about the slowest
thing out there.
 
T

Tony De

ara.t.howard said:
learn them both.

the speed will depend entirely on the application - for instance there
are c-bindings for many libraries in both python and ruby. if the
binding exists for one but not the other your application will be
faster in that one. frankly, if you are learning either one for
'speed' you've got real troubles - both are 100/10000 time slower than
pure c for cpu intensive tasks. we write ruby because it makes our
minds stop hurting and because it let's solve problems that we would
not be able to comprehend in other languages, and therefore which
would remain unsolved. python is quite good with regard to this too.

technically speaking you don't really learn a 'language' - you learn
an implementation of a turning machine and use it to solve problems.
the choice if implementation should be determined by

a) what you like.

b) what you require.

i order them that way because very little code gets written when you
hate what you are doing.

kind regards.

a @ http://codeforpeople.com/

Here.. Here... As a person new to Ruby with VB, Delphi, & C experience,
you goto love both what you do and what you use to get it done.
Otherwise..., it's like climing Mauna Kea Hawaii 13K+ from the sea
floor. It's more work thank it has to be. M2C

tonyd
 
M

Mark Ryall

[Note: parts of this message were removed to make it a legal post.]

Absolutely - I suspected I might regret posting that statement. It's a bit
extreme and more than a little sycophantic given the circumstances.

Forums such as this seem sometimes to have an effect of making people take
more extreme points of view than they would in person - there're few topics
more boring than a language flame war.

I suppose i meant just to say that performance is not a factor i'd use to
choose between python and ruby - i'd pick the one that allowed me to write
code that more clearly expressed my intentions to its most important
audience - myself sometime in the future and other unsuspecting developers.

Ruby's expressiveness and flexibility has to some extent been achieved by
sacrificing performance (this statement would be true for python also). For
me, those benefits far outweigh the cost. I have the indefensibly
subjective opinion that ruby allows me to enjoy writing code that i imagine
other people could easily understand - perhaps making children cry isn't
probably something that i really want now that i've considered the matter
further.

Most of the time, choosing a language based on it having the fastest runtime
environment is probably very early premature optimisation.

If you have little experience using either, try to learn both and see which
suits your style.
 
M

M. Edward (Ed) Borasky

Mark said:
I suppose i meant just to say that performance is not a factor i'd use to
choose between python and ruby - i'd pick the one that allowed me to write
code that more clearly expressed my intentions to its most important
audience - myself sometime in the future and other unsuspecting developers.

It might not be your choice but there *are* those who *will* use it as a
deciding factor. And that is enough justification for the efforts of the
Ruby 1.9, jRuby and Rubinius teams' efforts to make Ruby's performance
competitive with that of the other major scripting languages.

[snip]
Most of the time, choosing a language based on it having the fastest runtime
environment is probably very early premature optimisation.

Those on this list who know me probably realize that "premature
optimisation" is a concept I find difficult to grasp. I'm very familiar
with the philosophies of the great gurus Dijkstra, Hoare, Milner, Knuth,
etc. -- I "grew up" with them, so to speak. And I don't think there's
*anything* in their writings that justifies inattention to performance
concerns at *any* stage in the software development cycle, *including*
selection of a programming language!

In fact, Dijkstra, in _A Discipline of Programming_, explicitly calls
out that one must pay attention to the twin concerns of correctness and
efficiency. And, while the hardware is orders of magnitudes faster and
cheaper than it was when Dijkstra wrote that, throwing hardware at an
inefficient design is still not economically viable in the long run and
probably never will be.
 
T

Todd Benson

Mark Ryall wrote:
Those on this list who know me probably realize that "premature
optimisation" is a concept I find difficult to grasp. I'm very familiar
with the philosophies of the great gurus Dijkstra, Hoare, Milner, Knuth,
etc. -- I "grew up" with them, so to speak. And I don't think there's
*anything* in their writings that justifies inattention to performance
concerns at *any* stage in the software development cycle, *including*
selection of a programming language!

I don't know Edward or those other guys <shy smile> but I agree.
Starting out one, seemingly linear way may prevent you from -- or slow
your progress towards -- a different design paradigm that could be
vastly better. (Note, I used "better", not "faster"). I see this a
lot on how people approach some of the Ruby Quiz questions.

Todd
 
R

Robert Dober

we write ruby because it makes our minds stop hurting

I would put this right next to the famous "Ruby stands out of your
way" quote (Matz', right?).
Very nicely put indeed.

Cheers
Robert
 
B

Brian Adkins

Hello,

I am looking at the couple of scripting languages I found the best
two one is Ruby and other is Python. I want to learn one of these
languages but I dont know the prons and crons of these 2 languages.
But as the 1st look I want to know which one of these languages will
be fast when we are running the application..

How did you determine that "the best two" were Ruby and Python if you
"don't know the pros and cons" of the two languages?
 
I

Isaac Gouy

W

William James

[Note: parts of this message were removed to make it a legal post.]

It does seem a somewhat inflammatory statement to make on this list.

Clearly it is a completely subjective argument but i think if you want
incredible performance, C is a pretty good option

I disagree. It's too low-level and laden with pointers.
Use Pascal (FreePascal).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top