This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ruby and the fly likes Is Ruby a scripting or  a programming Language? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Is Ruby a scripting or  a programming Language?" Watch "Is Ruby a scripting or  a programming Language?" New topic
Author

Is Ruby a scripting or a programming Language?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Guys,

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?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
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.


Ping & DNS - my free Android networking tools app
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Ulf,

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: 41137
    
  45
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.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

So what can we say about Ruby?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Nothing - until you define what a scripting language is.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

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: 41137
    
  45
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

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.

Thanks!
[ September 09, 2007: Message edited by: Roseanne Zhang ]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Thanks guys for all the insights!
Shiv Sidhaarth
Ranch Hand

Joined: Aug 06, 2001
Posts: 119
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: 41137
    
  45
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.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

I know that it is a old thread. :roll: Scripting langauge support dynamic binding unlike programming langauge like Java.


Groovy
Tina Ma
Ranch Hand

Joined: Nov 29, 2007
Posts: 198
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: 41137
    
  45
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
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: 41137
    
  45
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
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Ruby a scripting or a programming Language?
 
Similar Threads
Object Oriented Scripting
String execution
TAlly and my Database
Pure OO
How righteous to compare OO 'Scripting' Language(Ruby) with "THE" OO Language (Java)?