David Masover
2/16/2009 7:49:00 AM
Soh Dubom wrote:
> Ken Bloom wrote:
>
>> On Sat, 14 Feb 2009 20:41:52 -0500, Soh Dubom wrote:
>>
>>
>>> Is it true that ruby language will change to a compiled or jited
>>> language, like .net or java?
>>>
>> [snip]
>>
>
> Hum, does it make Ruby 1.9 a compiled language as, let's say C#? The
> reason I got interested in Ruby is because it's an interpreted language
> and I don't have to, for every change, re-compiled it
>
The short answer is: Yes, it's interpreted, in roughly the same way that
Perl, Python, PHP, and JavaScript are interpreted. No, you don't have to
recompile anything after every change -- in fact, many frameworks (Rails
included) have a "development mode" which lets most changes be
incorporated immediately into your app while it's running. And yes, it
does mean you probably have to give your source code to anyone who needs
to run your program on their local machine.
The longer answers you are getting are about the technical details,
probably pre-emptively heading off questions like "If it's interpreted,
isn't it slower?" And it turns out, what you're talking about is
completely different than the question of whether a language is actually
compiled to native code.
For example, there's no reason you couldn't write a shell script which,
when it's run, immediately compiles a large string (as C) into a binary
and runs that. Similarly, it's probably possible to bundle up a JAR
containing both JRuby and your app, and whether or not any of it was
actually compiled ahead of time, such that it can simply be run as a
Java program. There are even projects which embed Ruby source code and
the Ruby interpreter to produce a single EXE (on Windows). Similarly,
gcj can compile Java bytecode down to actual binary, and LLVM takes
languages like C and makes them JIT.
So the longer answer is, unless your concern is performance, you should
only care about the shorter answer.