What is the truth? Is Ruby a scripting or a programming language. If so what exactly is the difference between a scripting and a programming language keeping in mind both are Object Oriented?
Well, without a definition of what constitutes a scripting language, and what constitutes a programming language, this question is really impossible to answer. But I would say that object orientation does not play into it, as there are both scripting languages and programming languages that aren't OO.
You clearly confused me...lets boil down to this...what is scripting and what is programing? I found a lot of information in google but weren't quite satisfactory.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
It's proper that you should be confused , because there is no generally agreed-upon definition of the term scripting language vs. programming language. So any categorization of a particular language is relative to what the person doing the categorization understands those terms to mean.
For some languages it's pretty uncontroversial, e.g. Java and C are not scripting languages, while the Unix shell language is a scripting language.
I'd say that scripting languages are in any case a subset of programming languages, i.e. all scripting languages are programming languages.
I've read at many places that Ruby can do what Java can do and rails can do what Servlets/JSP/Hibernate/Struts collectively can do. Would this be true?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
I've read at many places that Ruby can do what Java can do
Well, that goes into computer science theory, and namely Turing completeness. Principally, just about all commonly used programming languages can do the same things. As that article states, it's actually hard to find a language that can't do some of the things Turing-complete languages can do, and is still somewhat interesting. In this sense, Ruby and Java are the same.
But just because the same things are possible to do, it doesn't mean they're easy or efficient to do. Some languages are much better at certain tasks than other languages.
Roseanne Zhang
Ranch Hand
Joined: Nov 14, 2000
Posts: 1953
posted
0
Is Ruby a scripting or a programming Language?
Yes, Ruby is a scripting language. Yes, Ruby is a programming language.
Obviously, the OR here is an inclusive or, not an xor.
The use of interpreter rather than compiler is the major difference between a scripting language and programming language.
Ruby uses Interpreter.
Java uses Complier.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Originally posted by Shiv Sidhaarth: The use of interpreter rather than compiler is the major difference between a scripting language and programming language.
No. Perl and TCL -both generally regarded as scripting languages- use compilers.
Java uses Complier.
At runtime Java uses both an interpreter and a compiler.
A more distinctive sign of a scripting language used to be that no native code is generated permanently, meaning stored on disk. In that sense, Perl and TCL are scripting languages, because the native code they generate exists during runtime only. But of course the same is true for Java, so that's not a distinguishing feature.
Ruby is an object oriented scripting language which is used to write programs. And... a scripting language is a form of programming language which do not need a compiler. It is directly interpreted at runtime, after hitting run.
Tina
SCJP 1.4, SCWCD 1.4
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Needing a compiler is a strong term; I'm not sure any language really needs a compiler in order to work. For practical reasons, maybe, but theoretically - I don't think so.
As an aside, the Java runtime is principally an interpreter; the native code compiler is optional (although generally used, of course).
I like Lasse's definition of a scripting language not needing to define methods and classes. There are languages I would classify as programming (not scripting) languages that do not require methods either, though - Scheme comes to mind, and thus probably Lisp. [ June 11, 2008: Message edited by: Ulf Dittmer ]
Rusty Shackleford
Ranch Hand
Joined: Jan 03, 2006
Posts: 490
posted
0
Originally posted by sreerupa basu: Ruby is an object oriented scripting language which is used to write programs. And... a scripting language is a form of programming language which do not need a compiler. It is directly interpreted at runtime, after hitting run.
That implies that Javascript and Ruby are similar. JS is a scripting language. Ruby is a programming language that can also be used for scripting.
The compiler argument is way off base. Languages that are considered to be scripting languages are often used for the back end of web apps(Perl, Python, Ruby, PHP). However, You can use C instead of say Perl. Does that make C a scripting language?
Furthermore, it is not impossible to write a C interpreter. Would that make C a scripting language?
IMO, JS, ActionScript, etc are scripting languages. C, C++, Java, Ruby, Perl, etc are programming languages, even though some are used often as scripting languages.
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Originally posted by Rusty Shackleford: JS is a scripting language. Ruby is a programming language that can also be used for scripting.
That's the main point of what we're talking about. What definition of "scripting langauge" are you working with?
Rusty Shackleford
Ranch Hand
Joined: Jan 03, 2006
Posts: 490
posted
0
Does it really matter if you consider Ruby to be a scripting language rather than a programming language. Do they really need to be disjoint terms? I think that is the bigger question.
By any meaningful definition of scripting and programming language it can be considered both.
It is like asking what is and what isn't Web 2.0? It is a term with no real value. [ June 11, 2008: Message edited by: Rusty Shackleford ]