DEV Community

Cover image for Scripting vs. Programming Languages
Tiberius Mairura
Tiberius Mairura

Posted on

Scripting vs. Programming Languages

The difference between a scriting and a programming language lies in how the code written is converted to machine language.

Once you have written your code, we need to find a way to convert from human readable language to machine readable format. To achieve this, the program can either be compiled in the case of programming languages or translated in the case of scripting languages.

Whereas a programming language requires a compiler to to be converted to a machine notation, a script language requires, well, an Interpreter. To compile or translate is to transform a program from a high level language(human readable source code) to object/machine code.

Compiled programs are generally relatively faster than interpreted programs because they are first of all converted to machine language before execution. Additionally, compilers scan the entire program and report any errors if any before execution whereas interpreters execute code line by line and throw errors only when they incur them.

However, With the advances in hardware and computation technologies, the difference between scripting and programming languages is gradually fading. When classifying languages as either scripting or programming, it is significant to consider the enviroment of execution of that specific language. This is important because one can design an interpreter using a programming language for example C++ and use it as a scripting language. Similarly, one can use a scripting language as a compiled language. For instance Google Chrome's V8 engine is a JavaScript engine that compiles JavaScript (traditionally, a scripting language) to a machine code.

Examples of Scripting Languages

Some of the languages that are tranditionaly classified as scripting languages include JavaScript, Python, and PHP

Examples of Programming Languages

Some of the languages that are tranditionaly classified as programming languages include C, C++

What about Java?

You might be tempted to mention Java as being strictly a compiled language but that would be wrong since Java is both an interpreted and compiled language.

Key Takeaways

  • Scripting languages need a translator to be converted to machine code

  • Programming languages, on the other hand, need a compiler to be converted to machine code

  • Programming languages tend to execute faster than scripting languages

  • A compiler scans the entire code and thus identifies erros before execution

  • An interpreter translates code line by line and only throws errors when it incurs them

  • Examples of scripting languages include Python, PHP, JavaScript

  • Examples of programming languages include C, C++

Top comments (0)