Is Ruby is a Scripting Language or Compiled Language?

Answers were Sorted based on User's Feedback



Is Ruby is a Scripting Language or Compiled Language?..

Answer / abhi2810

In general, programming languages fall into one of two
categories: they're either compiled languages or scripting
languages. Let's explore what each of those terms means, and
understand the differences between them.

Compiled Languages: The language in which you write an
application is not actually something that your computer
understands. Your code needs to be translated into bits and
bytes that can be executed by your computer. This process of
translation is called compilation, and any language that
requires compilation is referred to as a compiled language.
Examples of compiled languages include C, C#, and Java.

For a compiled language, the actual compilation is the final
step in the development process. You invoke a compiler --
the software program that translates your final
hand-written, human-readable code into machine-readable code
-- and the compiler creates an executable file. This final
product is then able to execute independently of the
original source code.

Thus, if you make changes to your code, and you want those
changes to be incorporated into the application, you must
stop the running application, recompile it, then start the
application again.

Scripting Languages: On the other hand, a scripting language
such as Ruby, PHP, or Python, relies upon an application's
source code all of the time. Scripting languages don't have
a compiler or a compilation phase per se; instead, they use
an interpreter -- a program that runs on the web server --
to translate hand-written code into machine-executable code
on the fly. The link between the running application and
your hand-crafted code is never severed, because that
scripting code is translated every time it is invoked -- in
other words, for every web page that your application renders.

As you might have gathered from the name, the use of an
interpreter rather than a compiler is the major difference
between a scripting language and a compiled language.

The Great Performance Debate: If you've come from a
compiled-language background, you might be concerned by all
this talk of translating code on the fly -- how does it
affect the application's performance?

These concerns are valid -- translating code on the web
server every time it's needed is certainly more expensive,
performance-wise, than executing pre-compiled code, as it
requires more effort on the part of your machine's
processor. The good news is that there are ways to speed up
scripted languages, including techniques such as code
caching and persistent interpreters. However, both topics
are beyond the scope of this book.

There's also an upside to scripted languages in terms of
performance -- namely, your performance while developing an
application.

Imagine that you've just compiled a shiny new Java
application, and launched it for the first time ... and then
you notice a typo on the welcome screen. To fix it, you have
to stop your application, go back to the source code, fix
the typo, wait for the code to recompile, and restart your
application to confirm that it is fixed. And if you find
another typo, you'll need to repeat that process again.
Lather, rinse, repeat.

In a scripting language, you can fix the typo and just
reload the page in your browser -- no restart, no recompile,
no nothing. It's as simple as that.

Is This Answer Correct ?    63 Yes 0 No

Is Ruby is a Scripting Language or Compiled Language?..

Answer / jhon

ruby is scripting language

Is This Answer Correct ?    11 Yes 0 No

Is Ruby is a Scripting Language or Compiled Language?..

Answer / muthuselvam,v

Ruby is Scripting Language

Is This Answer Correct ?    6 Yes 0 No

Is Ruby is a Scripting Language or Compiled Language?..

Answer / ib

ruby is scripting language....

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

Are there any disadvantages of ruby on rails? If yes, mention them.

0 Answers  


what is the function of garbage collection in Ruby on Rails?

0 Answers  


What are float, dig and max?

0 Answers  


what are helpers and how to use helpers in ror?

0 Answers  


What is the process for creating a controller for the subject? What is its role?

0 Answers  






How is visibility of methods changed in ruby (encapsulation) ?

0 Answers  


write a program to show the usage of sql in the database file?

0 Answers  


Am Fresher ..,i dont know seven controller methods.am searching in google .but am not getting .help me

0 Answers   Baidu,


am new to ruby. tell me one thing. i can view my project on browser when i write "ruby script/server". otherwise i cant view my project on localhost. what i have to do to view my project always on browser? pls help

5 Answers  


How do rails implement ajax?

0 Answers  


What is ORM in Rails?

0 Answers  


Do you know what is cross-site request forgery (csrf) and how rails is protected against it?

0 Answers  


Categories