DEV Community

Oğuzhan Olguncu
Oğuzhan Olguncu

Posted on

2 2

Explain the difference between compiler and interpreter like I'm five

Top comments (4)

Collapse
 
dfockler profile image
Dan Fockler

A compiler is like baking a cake. You do all the steps to make the cake, and then finally you bake it into some delicious treat.

An interpreter is like making a salad. You do all the steps and when you've finished them you've made a salad.

Collapse
 
itachiuchiha profile image
Itachi Uchiha

Being a lover is a kind of interpreted language. Marriage is a kind of compiled language. Behind these, love is an interpreter. If you're a compiler or interpreter, that doesn't matter. In both situations, you have an interpreter.

Other things just an output.

Of course, this is a stupid example. But you feel more flexible with a lover. Your decisions will be interpreted when you need to use them.

While you're married, you can't flexible. Your all decisions will analyze first and then compile.

I don't know, am I crazy? What the heck is that example?

Collapse
 
ogzhanolguncu profile image
Oğuzhan Olguncu

If I had any previous knowledge about compilers and interpreters, I would definitely forget every bit of it after that example 😄.

Collapse
 
ashertoqeer profile image
Asher Toqeer

Hey there, let's play a game
Here is a paper, You need to open it, there are some lines written on the paper, you have to read one line at a time and act as it says. For example:

Open eyes (open your eyes)
Smile (simple)
Say Hi (say Hi)
Close eyes (close your eyes)

Just one line at a time, one by one, got it? You are an interpreter

Let's play another game, here is a paper, read it and remember all of the acts, then give that paper back to me.
Now act as the paper said
You are now a compiler

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay