iOS Development interpreter and compiler

Source: Internet
Author: User

Rookie often confuse compiler and interpreter, helpless, so to master consult.

Master said:

"

The interpreter is a one-piece explanation of the execution source language. For example, Php,postscritp,javascript is a typical interpretive language.

The compiler compiles the source code all the way to the target code, does not need the compiler at execution time, runs directly on the platform which supports the target code, so the execution efficiency is much faster than the interpretation execution. For example, C language code is compiled into binary code (EXE program), executed on the Windows platform.

"

Rookie said: "I still do not understand, can give an image of metaphor?" ”

Master said: "Tell you a story." ”

My mother called her son and said, "Your father has not been in good health, but he is not busy at home."

Son think, yes, Dad is old, poor health, buy some yak bone marrow strong bone meal is good, so the son went to the supermarket to buy yak bone marrow zhuang bone meal.

Son again want Ah, recently gold partner is very fire, buy some give dad try. So the son went to buy a gold partner again.

After returning from the supermarket, the son also thought mother said "home not lively", well, the home of the little emperor since boarding school is relatively less back, it is estimated that the elderly want to grandson. The son made a phone call to his high-up son and asked him to come back at the weekend.

  

My mother called her daughter and said, "Your father has not been in good health recently, but the family is less busy."

My daughter thought, what should I do for Dad? So she took out a piece of paper to start listing articles, first written on the strong bone meal and gold partner. Then, think of the old man to see the grandson should be good, so on the paper added a sentence, family back to parents there to visit. On the last piece of paper it reads:

1. Zhuang bone meal and gold partner

2. A family to visit their parents

After the daughter saw her son-in-law, the information on this piece of paper was sent to the working son-in-law.

Son-in-law to see it, after work to the supermarket to buy a tonic, and then drive home with his wife and children to visit his father-in-law.

Did you think of anything?

Rookie said:

I don't know if it's right: My son is like an interpreter, a little bit of thinking. Daughter is like a compiler, son-in-law is like a platform, the daughter after listening, on the paper listed all the things to do, son-in-law to follow the instructions.

Master said:

That's the way it is. Son of Mother's words is a piece of execution, the daughter is the mother's words throughout the translation into the platform can understand the target language-text messages, the whole by the son-in-law directly executed. The latter will be more efficient to execute.

Functionally, the interpreter and the compiler are really different.

However, both in terms of process and structure, they are very similar.

When the son and daughter heard the mother's words, they were thinking from two aspects: the old man's body and the old man's thoughts on the junior. According to this, the son and daughter have made their own decisions. Just a direct to do, the other is to do the things translated into another carrier-SMS-to the storage.

The same is true of the interpreter and compiler, which, after being read into the source language, is parsed, parsed, and semantically parsed by both the interpreter and the compiler, and then they begin to differ. The interpreter chooses to execute the statement directly after the semantic analysis, and the compiler chooses to store the semantics in an intermediate language after the semantic analysis, and then translates it into different machine languages (executable program) by different backend. As shown in the following:

In short, parsers and compilers are functionally different, but there are many similarities in structure, and there is no intrinsic difference in development, which is one of the reasons why many people confuse the two. Are you developing parsers or compilers? It is OK to make a decision based on the actual needs of the function.

iOS Development interpreter and compiler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.