Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scripting Language vs Programming Language [closed]

Can anyone explain the difference between Scripting Language and Programming Language please?
Also can you state some examples for each. I have Googled a lot but I always find the best answers from Stack Overflow.

like image 801
Rahul Reddy Avatar asked Jun 22 '13 17:06

Rahul Reddy


People also ask

How is a scripting language different from a programming language?

Scripting languages are translated and cannot be converted into an executable file, whereas programming languages are generally compiled and created to executable the file. Scripting languages can combine existing modules or components, while programming languages are used to build applications from scratch.

Is programming language and scripting language same?

A programming language is a type of computer language that consists of a set of instructions for communicating with computers. A scripting language is a kind of programming language that is used to automate the execution of operations in a runtime environment. Most programming languages are compiled.

Is there a closed source programming language?

A language cannot be closed-source. Its compiler and run-time libraries can be closed-source. A formal grammar of a language can be kept as a secret though and be legally protected (NDAs, etc.) and fees collected for usage.


Video Answer


1 Answers

Scripting languages are programming languages that don't require an explicit compilation step.

For example, in the normal case, you have to compile a C program before you can run it. But in the normal case, you don't have to compile a JavaScript program before you run it. So JavaScript is sometimes called a "scripting" language.

This line is getting more and more blurry since compilation can be so fast with modern hardware and modern compilation techniques. For instance, V8, the JavaScript engine in Google Chrome and used a lot outside of the browser as well, actually compiles the JavaScript code on the fly into machine code, rather than interpreting it. (In fact, V8's an optimizing two-phase compiler.)

Also note that whether a language is a "scripting" language or not can be more about the environment than the language. There's no reason you can't write a C interpreter and use it as a scripting language (and people have). There's also no reason you can't compile JavaScript to machine code and store that in an executable file (and people have). The language Ruby is a good example of this: The original implementation was entirely interpreted (a "scripting" language), but there are now multiple compilers for it.

Some examples of "scripting" languages (e.g., languages that are traditionally used without an explicit compilation step):

  • Lua
  • JavaScript
  • VBScript and VBA
  • Perl

And a small smattering of ones traditionally used with an explicit compilation step:

  • C
  • C++
  • D
  • Java (but note that Java is compiled to bytecode, which is then interpreted and/or recompiled at runtime)
  • Pascal

...and then you have things like Python that sit in both camps: Python is widely used without a compilation step, but the main implementation (CPython) does that by compiling to bytecode on-the-fly and then running the bytecode in a VM, and it can write that bytecode out to files (.pyc, .pyo) for use without recompiling.

That's just a very few, if you do some research you can find a lot more.

like image 176
T.J. Crowder Avatar answered Oct 01 '22 20:10

T.J. Crowder