What are the Interpreted and Compailed programming languages?

Before to understand Interpreted and Compailed programming languages, we need understand programming languages. Programming languages help us tell computer what to do. Computers doesn't use human language, they use machine code. Machines understand binary code, that's, ones and zeros.

We have humad readable programming languages, so it's easy to communicate with computers. 2 common categories for programming languages are Interpreted and Compiled. There are many programming languages that are classified under this 2 categories.

Interpreted Programming Languages

Interpreted programming languages are languages where the code is not directly compiled into a single executable file before running. Instead, the source code is executed line by line by another program called an interpreter. Translators are built into your web browser, or they require a program on your computer to translate the code. Source code written in one of the interpreted programming languages runs on almost any operating system with the right interpreter.

Common examples: JavaScript, Python, Lua, PHP, Ruby

Compailed Programming Languages

Compiled programs are the types of software you use on your computer or device, such as a music player or an operating system. These programs are bundled into a single executable file, which makes them ready to run. Typically, they are larger and more complex applications. One of the main purposes of compiled programs is to handle tasks that require more processing, like converting source code into something the machine can understand. A compiler takes the written code and produces an executable file.

Common examples: C, C++, C#, Java

In short, it gathers all the code into one file, so when you double-click the app, it immediately runs on your device.

Comparison

FeatureCompiled LanguagesInterpreted Languages
ExecutionCode is converted into machine code first, then run as an executable file.Code is executed line by line by an interpreter.
SpeedUsually faster, since code is pre-translated into machine instructions.Generally slower, because translation happens while running.
PortabilityLess portable — needs recompilation for different platforms.More portable. Same code often runs on multiple platforms via interpreter.
DevelopmentLonger development cycle (must compile before running).Faster testing and debugging. You can run code immediately.
ExamplesC, C++, Rust, Go, Swift, Java.Python, JavaScript, Ruby, PHP, Perl.
Error DetectionMany errors caught at compile-time before execution.Errors appear only when the specific line of code is executed.

Summary

  • Interpreted programming languages create source code that runs through an interpreter in your device's operating system or on your web browser.
  • Compiled programming languages create executable files that are grouped in programs on your device.
  • Compiled programming languages like C and Java are used to write larger programs like operating systems and other executable files.
  • Interpreted programming languages like javascript and python are used to write code to complete repetitive tasks within a web browser or computer.