Understanding Compiled | Interpreted | Hybrid languages

Jeffry Tandiono
2 min readMar 26, 2020

--

After the whole source code has been developed, what next?
Getting the source code converted to machine code before it can be run.

There are 3 ways of doing this:
1. Compiling
2. Interpreting
3. Hybrid (Just In Time)

Compiled Language

The source code will go through a compiler and return a machine code call executable file. By doing this, the user machine won’t even see the code, they only need to get the executable file and run it.

Most of the game on windows used contained on a folder with an executable file called .exe. We just run the file and the game launch, the same as desktop program used on the bank.

Pros

  • The program is immediately ready
  • Usually faster
  • Source code is private and safe

Cons

  • Not cross-platform (Mac-Windows)
  • Need to prepare for different CPU/Memory machine (not flexible)
  • Compiling become an important extra step that needs to be considered

Interpreted Language

The source code will be pass as a copy directly to the user machine. The user machine will interpret the source code when the machine wants to run the program. The interpreter is different than the compiler because the interpreter won’t create another file and run the code line by line on the fly.

When we browse the web on the browser, the page usually contains a javascript file. The javascript file is a source code that was being interpreted by your browser to run the source code immediately at that time.

Pros

  • Cross-platform and portable
  • Easier to test because no compiled step
  • When things go wrong, easier to debug since having access to the code

Cons

  • Need interpreter on the user machine
  • Slower because having the need to run
  • Source code is public

Hybrid Language

Because of both having pros and cons, comes a new challenger that combines both. Rather than compiling on upfront that can be inflexible or interpret the code on the user machine that can be slow, hybrid doing that half of both.

Upfront it is compiled to become a file called Intermediate language, that close to a machine code that can be portable cross-platform. The user machine will take the Intermediate language file and do the last step to compile which usually called Just in Time compilation (JIT compilation). The Intermediate language is also called byte-code.

The differences between each hybrid language is just how much of compilation will be done on the owner of the source code and how much of the JIT compilation needs to be done by the user machine.

Languages

Compiled Language

C, C++, and Objective-C

Interpreted Language

PHP, Ruby, and Javascript

Hybrid Language

Java, C#, and Python

--

--

Jeffry Tandiono
Jeffry Tandiono

Written by Jeffry Tandiono

Personal Growth Enthusiast | Software Developer | Love sharing | Check my stuff out!

No responses yet