from 0 and 1 to programming languages

Source: Internet
Author: User

What is a programming language?

To give an example:

If we do not speak English, and a foreigner who can not speak Chinese, how to do? Find a translator.

Computers only know the machine language consisting of 0 and 1. Use 0 and 1 to tell the computer to work very tired, human language easy to understand, learning fast, high efficiency.

If you define a set of canonical grammars, explain how to convert human languages into machine languages. This allows the use of human language to tell the computer what to do, which is the programming language.
The process of translating programming languages into machine languages, 0 and 1,--, is called compiling.

There are many kinds of programming languages. Previously learned assembly language, Python,c/c++ languages, Java, C # and so on.

Machine language-describe instructions with 0 and 1
Assembly language-essentially the same as the machine language, except that the instruction is easier to identify and memorize by using abbreviations in English
High-level language--the merging of multiple related machine instructions into a single instruction, compared to the assembly, removes the specific operation. Python, C + + language, Java, C #, PHP are all high-level languages.

Java is generally used for enterprise development, C + + mainly for system development, PHP is mainly used for web development.

interpreted and compiled languages

The computer itself does not recognize high-level languages, and when we run a program, we need a "translator" to translate the high-level language into a language that the computer can read. The "translation" process is divided into two types:

1. Compiling

Compiled language before executing the program, the compiler will first execute a compilation process, the program compiled into machine language. Then, when the program runs again, do not "translate", but can be directly executed. Like the C language. The advantage of a compiled language is that it does not have to be explained when running the program, and can be used directly with the translated files.

2. Explanation

The interpreted language is not compiled, but is interpreted by the interpreter, and then run, as the program runs. Like Python.

After the emergence of virtual machine-based languages such as Java, programming languages are not simply divided into compiled or interpreted languages. Java is the first time a compiler compiles code into a bytecode file (for cross-platform), then executes Java bytecode in the JVM and interprets it as a machine language. So we say Java is a semi-compiled, semi-explanatory language.
C #, at the first execution, compiles the code into an IL intermediate code file, which is then executed by the JIT compiler to compile the cost of the machine code. Equivalent to compiling two times.

from 0 and 1 to programming languages

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.