On Sep 23, 7:55 pm, “Bill K.” [email protected] wrote:
amazing easy to achieve machine code speeds from Python as opposed to
"The difference with the traditional approach to JIT compilers is
redefined.
Indeed, there are a couple of already existing projects in
this general category:
http://rubyforge.org/projects/ruby2c/
http://rubyforge.org/projects/ruby2cext/
[1]Psyco - Introduction
Regards,
Bill
ruby2c and ruby2cext are hacks that convert Ruby code into C code.
Pysco is a JIT that works transparently at runtime.
If you want to code C/C++ then code C/C++ and be done with it.
If you want to code Ruby then live with the benefits or detriments of
using Ruby including the less than stellar performance.
I have coded both Ruby and Python and for me some aspects of Ruby code
is bass-ackwards and less than intuitive even though Ruby is supposed
to be an easy to understand langauge that is intuitive, blah-blah-
blah. For me Python seems far more intuitive than Ruby could ever
be.
Maybe I am just not cool enough to think Ruby is god’s gift to
programming but when I write code I want nothing less than performance
relative to the amount of time I wish to spend writing code.
If I wanted blazing performance I would write Aseembly Language (been
there and done that back in the day when 8 bits was all there was) but
one must commit a lot of time to hand-crafting Assembly code and most
of the time I just don’t have that much time to spend writing code.
Once upon a time I used to code everything in C but that was well
before C++ existed as anything other than an idea. And ‘yes’ I was
coding some rather intense C code, back in the day, using C++ like
constructs.
Python uses some of the same syntax as Ruby. Python is dynamic like
Ruby. Python source can be compiled into byte-codes and rolled-up
into an .EXE for easy delivery to end users. I can code Windows
services usign Python if I wanted to but I cannot code Windows
services using Ruby whether I wanted to or not.
When I write code that I wish to distribute I would rather not have to
ship source code. I realize shipping source code is supposed to be
“cool” but I think it is more “cool” to withhold my source code so my
customers might be more tempted to buy my object-code than hack-up my
source code. Also I think it is more “cool” to cause those who wish
to reverse engineer my code have to spend more time doing so rather
than simply reading the source code such as is the case with Ruby.
Also if someone could code a JIT for Ruby like Psyco then someone
would have done this already and we wouldn’t have to talk about ruby2c
or ruby2ext.
The bottom line is this: “Ruby coders will always have to spend more
time making their Ruby code run faster than Python coders will have to
spend making their Python code run faster and Python code will always
run faster than Ruby code even after YARV has been released to save
the day until such time as someone codes a JIT for Ruby.” ← Wake me
up when this statement proves to be false because I will be happy when
the day comes when Ruby code runs faster than Python code and I don’t
have to ship Ruby source code.