DEV Community

Prakash Pawar
Prakash Pawar

Posted on • Edited on

How programming Language Works in less than 2mins

Hey, i am Prakash Pawar and today i will try to explain you how Programming Language works inside the computers.

Computer only understands instruction in Machine Language Code.

But there is a catch that it's harder to write program in Machine Language code.
So we have to write program in Higher level languages like , Java, C++, Ecmascript , Python and more.
The program written in Higher level language is called Source Code.
But we cannot execute this Source Code directly in computer.

So we have to convert it into Machine Language Code.
We need some special translators which are programs basically written in Machine Language Code.
And these translators are called Language Processors.

There are 3 types of Language Processors.

  1. Compiler
    It is used for Higher Level Language.
    It reads and execute whole program in once and then throw errors if any occurs.
    Higher Level Language which uses compilers are: C, C++, C#, Pascal, Java and more.

  2. Assembler
    It is used for Assembly Level Language(Mnemonic codes).
    It reads Assembly Level Language instructions from given input.

  3. Interpreter
    It is used for Higher Level Language.
    It reads and execute source code line by line and throws error after every line if any occurs.
    Higher Level Language which uses interpreter are: Ecmascript, VB Script, Python, Perl and more.

Here i created a FlowChart to understand the process:
(Below in image, Yellow is Compiler, Blue is Assembler, Green is Interpreter)

Thanks for your 2 minutes and that’s it now you know what’s going on inside the machine with your code. If you liked this article let me know via comments and you can retweets. You can also read this on Medium.

Top comments (7)

Collapse
 
ahmedhamdy2121 profile image
Ahmed Hamdy • Edited

Great article, but I think there is some kind of a mystery in whether compiler compiles to assembly first or like you said. For instance, I am confident that programming languages like C compiled first to assembly.
It is today's world that compilers and interpreters are continuously changing, so maybe it is worth sharing XD

Collapse
 
thevenice profile image
Prakash Pawar

Compiler is making mnemonics code ( which are also known as assembly language code) they will go through assembler. Even so interpreted codes goes to compiler, there are 50 more things going on inside but this is the simplest explanation i come up with.

Collapse
 
shankydnothairy profile image
dhadi shankara

This is a good summary and thanks for making it really simple and easy to understand. Could you do one with more details? Like how the flowchart goes for different languages which require more than one Language Process, like C?

Thread Thread
 
thevenice profile image
Prakash Pawar

Thanks :), Great idea, Yeah i will try to make a post this weekend.

Collapse
 
saurabhgoyal profile image
Saurabh Goyal • Edited

I have written a very similar article that covers popular languages and their various translators to have better clarity - Please check it out.

Understanding Assembler, Compiler, Interpreter and JIT Compiler

Collapse
 
riffat profile image
Rifat Masud

I suppose, you should tag this #beginner as-well

Collapse
 
thevenice profile image
Prakash Pawar

Done!