What are Scripting Languages?

December 26th, 2019


Blog Cover

Scripting languages are often confused with programming languages. Although, they can be used for the same purposes, their means of execution are quite different. In this article we'd look at what scripting languages are and how they are different compared to programming languages.

What are scripting languages?

These are languages which need to be interpreted by interpreters rather than being compiled. They use interpreters (developed for them) to convert their source code into machine codes which the computer would understand.

Difference between compilers and interpreters

  • Compilers converts the whole program at once while interprets converts the program line by line.
  • For compilers, the conversion is done before execution but conversion and execution takes place at the same time (which is line by line).
  • Compilers produce intermediate object code (set of instructions understood by a computer) which are then converted to executable codes but interprets do not produce such. They just interpret the source code to the machine.
  • Compilers are known to be faster than interpreters because the compiler converts all at once while the former does it line by line.
  • All errors in compilers are displayed after conversion at the same time but interpreters display errors one by one for each line. Hence, it is easier to detect erros.

Compilers and Interprets are generally the key terms in determining if a language is a program or a script.

Because they do not produce object code, scripting languages cannot directly access the low-level details of the hardware.

Examples are Javascript, PHP, Python, Ruby etc

Scripting Languages on websites

Scripting languages are commonly used to add functionality and interactivity to web pages (such as taking and processing inputs). This is usually done with javascript on the client-side (the user's browser). For these functionalities to be experienced, the user's browser (the client) would have to be able to interpret those scripts.

Other scripting languages are used on the server-side such as PHP. This enables creation and manipulation of data on the server such as data in a database. Obviously, the server would have to be able to interpret the language before it can be executed.

Connect with me ✨