Please elaborate the difference.
Write your answer…
In simple terms, this is the difference:
Native Compiled language: You write your code, you run the compiler and the compiler turns it into machine instructions (raw bytes) that the CPU itself can read and execute.
Interpreted language: You are writing a script and handing it to another program which executes code on the script's behalf. This "other program" is called the interpreter or the engine and it itself is usually a native compiled program, hence it has to at some point give machine code to the CPU; everything does because that's the only way to actually get the computer to do anything. Simply put - a script is a set of instructions for a program to execute whereas a native binary is a set of instructions for your machine's CPU to execute.
The key here is that, since with scripting, you don't have to "compile to machine code," that's why when you write a script you don't have to "build" it; you can just feed it straight into the interpreter which speeds up the overhead of writing/testing code a bit. The downside is that the interpreter itself has overhead because many more steps are involved than simply the machine reading one compiled program.
Hashnode is building a friendly and inclusive dev community. Come jump on the bandwagon!
💬 A beginner friendly place
🧠 Stay in the loop and grow your knowledge
🍕 >500K developers share programming wisdom here
❤️ Support the growing dev community!
Register ( 500k+ developers strong 👊)
|Entity||Programming Language||Scripting Language|
|Definition||A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer.||A scripting language, script language or extension language is a programming language that allows control of one or more applications.|
|Type||Compiler-based language||Interpreter based language|
|Usage||Developing something from scratch||Used to combine existing components|
|Running||Run independent of an exterior (or parent) program||Run inside another program|
|Design||Designed to get full usage of a language||Designed to make coding fast and simple|
|Conversion||Converts the whole program into machine language in one shot||Converts high level instructions into machine language|
|Creation||Creates a .exe file||Does not create a .exe file|
|Compilation||Needs to compile the program||There is no need to compile the program|
|Coding||Programming is making a full code of program||Scripts are just a piece of code|
|Temperament||Harder to code. Needs numerous lines of code for each function||Easier to code. Needs only a few short lines of code for each function|
|Complexity||Are complex||Are easy to use and easy to write|
|Development Time||Takes longer to develop as more code needs to be written.||Takes less time to code as it needs less coding.|
|Support||Explicit support of Data Types. Rich support for User Interface Design. Limited support for User Interface Design.||Implicit support of Data Types. Rich support for Graphic Design.Limited or no support for Graphic Design|
|Hosting||Does not require a host. Is self – executable||Requires a host|
|Cost||Increased maintenance cost||Reduced maintenance cost|
Hope this matrix will help you Ankit Shukla
Whilst the answers so far have some interesting information, they're NOT pointing out the distinction I'm familiar with on the term.
See, scripting languages use SOURCE distribution. Not all interpreters do. UCSD Pascal, most ROM BASIC's and so forth are interpreted, BUT they are NOT scripting languages because their distribution model is the intermediate bytecode, NOT the raw source. Whilst ROM BASIC tricks users into THINKING it's source distribution -- it is not. When you enter a line of code it is turned into bytecode, when you "list' the program it is reverse engineered back into legible code.
That's the distinction as I've understood it.
A "scripting language" is a subcategory of "programming languages", which generally refers to interpreted languages, as opposed to compiled languages. A compiled language is something which you compile to machine readable code, which is either straight up assembly code, or byte code, which has a closer correspondence to machine code, thus making it easier for the virtual machine to optimize either during compilation or during run time using a JIT (Just In Time) compiler.
In addition to other answers, "scripting language" often has the connotation of being a lightweight tool for automating a task quickly. Usually only the command line or a text editor is necessary to write a script; no compiler. Scripts may often only be a few lines long, such as a basic
awk script for transforming a text file. They often don't require a long list of imports. They are almost always loosely typed. The language will often provide simplified ways of completing common procedures, such as reading and writing to files, performing regex matching, or making a HTTP request. They can also be used as gluecode for automating tasks written in different languages.
Now, given that explanation, don't go thinking that scripting languages are any less capable than "programming" languages. Scripting languages can be used to write applications that are just as sophisticated and complex as compiled languages, often times in much less time.
Don't miss out!
Join the growing dev community
Get started (no password needed)
Or Sign in with: