Every program is a set of instructions whether it adds two numbers or sends a request over the server. Compilers and interpreters take human-readable code and convert them into computer-readable machine code.
Let’s consider an example: Think you’re on a tour in Spain. But you don’t know the Spanish language and that’s why you are facing trouble reading the menu in the restaurant and getting trouble feeding yourself. Ok now this problem has two solutions below:
Note!!! Read the blog carefully to find out the solution………
Compiled Language: Compiled languages are directly converted into the machine code so that the computer can execute the program. For this specific thing, these programs are way faster than the interpreted language. One of the best benefits is they give the developer control over the CPU and many hardware like RAM etc. It needs to be manually compiled first. So if the developer makes any changes in the code then he/she need to rebuild the program again.
First Solution: You need to get someone who knows Spanish and speaks English also very well. So that he/she can read the whole menu for you. And then you get a translated menu, which you can think of as compiled.
Examples of compiled language: C, C++, RUST, GO, and much more…
Interpreted Language: Interpreters run through a program line by line and executes the command. That makes a great developer experience and makes debugging easier. Interpreted languages are so much slower than the compiled language. But with the development of the JIT(Just In Time) compiler, this gap is filling.
Second Solution: Another solution is if you have a Spanish friend who is sitting next to you and reading every menu item line by line and you can stop him anytime when you want. Here your friend is the interpreter version of the menu.
Examples of Interpreted languages: Javascript, Python, PHP, Ruby, and much more….
Top comments (0)