Three types of compilation language, interpretive language and scripting language

Source: Internet
Author: User
Tags data structures

In the process of learning a variety of advanced programming languages, we always encounter some language types of nouns, understanding these nouns for us to understand the operational mechanism of high-level language is a great help.


A, compile-type language

Definition: Refers to the use of a dedicated compiler, for a specific operating platform (operating system) to a certain high-level language source code to be directly run by the hardware platform binary machine code (with operands, instructions, and the corresponding format), this process is called compiling A compiled executable file (. exe) that can be run on a corresponding platform (poor portability but high efficiency).

Some programs compile, you also need to compile the other good, may need to assemble more than two target code to generate the final executable file, called the link (can be implemented for low-level code reuse).

Typical compiled language has, we are very familiar with C language, C + + and so on.

In addition, the Java language is a very special language, Java programs need to compile steps, but do not generate a specific platform of the binary machine code, it is compiled to generate a platform-independent bytecode file (*.class) (The reason for good portability), this byte code can not be directly executed by the platform, The runtime needs to be interpreted by the interpreter as the binary machine code file of the corresponding platform; most people think Java is a compiled language, but we say that Java is both a compiled language and an interpretive language.


ii. Explanatory language

Definition: A language that is interpreted by a specialized interpreter into a specific platform-by-line machine code and executed immediately, equivalent to mixing the compiled language's compile-link process together.

Interpreted languages are inefficient to perform and cannot be run away from the interpreter, but their cross-platform type is easier, with only a specific interpreter available.

The common interpretive language is the Python (also the scripting language) and Ruby that I'm learning.


third, scripting language

Definition: A computer programming language created to shorten the traditional write-compile-link-run (edit-compile-link-run) process.

It is characterized by: The program code is the final execution file, but this process requires the participation of the interpreter, so that scripting language and interpretation of the language has a great connection. The scripting language is usually interpreted and executed, and the program is a text file.

Typical scripting languages are, Javascript,python, and so on.

corresponding to the scripting language is the system language, and their differences are:

1, the level of abstraction: this is the most important and most obvious difference. Scripting languages provide a higher level of abstraction for programmers. This is evident in the fact that, in the language itself, there are advanced data structures, such as lists and dictionary structures, and simple nesting and manipulation of the structure. This allows you to create a very successful program.

2. Type definition: System language is usually a strongly typed and static type definition. This means that the types of all variables are specified in the program and checked at compile time. Instead, the scripting language is the most loosely defined type, with no type declarations at all, and dynamic type checking at run time.

3, implementation: the characteristics of the system language is compiled. The program is compiled into an executable binary. On the other hand, the scripting language is characterized by an interpretation, that is, the instruction is executed immediately, and there is no intermediate state of compilation. This means that the scripting language is interactive (you can typing the command at the prompt and seeing the result), which is another big win. This completely removes the compilation process from the edit-compile-run loop.

4, Speed: The above three points are scripting language on the one hand in speed and efficiency, on the one hand, ease of use and the power of the expression of a compromise between the typical example. This allows the scripting language to execute at an order of magnitude slower than the system language. This is the most defamatory aspect of scripting language. Performance degradation is not a real problem, because the idea is to assemble components in a scripting language that is written in a fast system language like C. So all the things that need to run fast will run fast because they are implemented in fast language. Scripting languages are used only to tie things together, and these are usually not performance bottlenecks (or, if so, you need to re-examine your design).



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.