DEV Community

Oğuzhan Olguncu
Oğuzhan Olguncu

Posted on

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

Top comments (4)

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.

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?

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 😄.

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