While reading through a chapter in an IT book I was studying I saw the term ‘scripting’ and ‘scripting languages’ used, and out of curiosity I decided to do a little a research and put my findings into a nice blog.
Before we go in further detail let’s go over the actual definition of a Scripting languages. According to Wikipedia, a scripting or script language “is a programming language for a special run-time environment that automates the execution of tasks…”. Based on that definition alone, we can that scripting languages are programming languages, but not all programming languages are necessarily scripting languages. Now that we have a definition for a scripting language, let’s go over the two key distinctions between programming and scripting languages.
Code is compiled differently
When comes it comes to programming languages, the code is compiled or read using a compiler. This is quite different from the way that scripting languages compile their code. Scripting languages on the other hand uses what is referred to as an interpreter to compile code. The difference between a compiler and an interpreter is the rate at which the code is read. For example compilers read code in blocks whereas interpreters read code line by line. This means that for scripting languages, code is stopped from running whenever an error is found. In contrast, compilers run the entire block of code and return all the errors at once. This also allow compilers to perform much faster than interpreters.
Scripting languages are application dependent
Scripting languages are programming languages, but the differences between them and non-scripting languages is that they are specifically used in conjunction with the applications that are meant to run them; non-scripting languages are stand-alone and can be used to create fully functional programs independent of other applications. We also learned that typical programming languages use a compiler that read code in blocks whereas scripting languages use an interpreter that read code line by line.
I hope this was useful in helping understand the exact difference between scripting and programming languages. If you think there are some other key differences between the two please feel free to leave a comment!