The computer can not directly understand the high-level language, can only understand machine language directly, it must be high-level language should be translated into machine language, the computer can be value-based high-level language program.
There are two ways of translation, one compilation, one is explained. Only two ways to translate different periods of time. Compiler-based language to write programs before execution, requires a special compilation process, the program compiled into machine language file, such as exe file, after the run, then do not need to re-translate directly using compile the results on the line (exe file) because the translation only do once, run-time does not need translation, so the compiler-based language programs and high efficiency.
Interpretation is different, explanatory language does not need to compile and save a procedure, explanatory language translation only when running the program, such as basic explanatory language interpreter can be specialized to have a direct implementation of the basic program, each statement is is executed when it is translated. Such explanatory language is necessary to perform a translation of each one, the efficiency is low.
What is a scripting language?
HTML is commonly used text formatting and links. The programming language is typically used to machine a complex series of instructions issued.
2. Scripting language and programming language has many similarities with the programming language of its function more resemble some, it also involves the variable. And programming languages is the biggest difference between programming language syntax and rules are more stringent and complicated.
3. And the relationship code: Script is a language, the same by the program code.
Scripting languages do not compile, can be directly used by the interpreter to interpret.
5. Scripting languages are usually in text form, similar to a command.
For example, if you build a program, called aaa.exe, you can open. Aa file for the extension.
You for. Aa file specifies a set of written rules (grammar), when someone has prepared. Aa file, your application written to use such rules to understand people's intentions and to respond. Well, this is a set of rules scripting language.
java is very special, java program also needs to be compiled, but did not directly compiled as machine language, but compiled as byte code, and then explain the way of implementation of the byte code. Java can be compiled both can also be interpreted. By the compiler, Java programs can be translated into an intermediate code - known as bytecode - Java interpreter can be interpreted platform-independent code. Through the interpreter, each Java byte instructions to be analyzed, and then run on a computer. Just compile time, runtime interpreted. The following diagram shows how it works:
Java byte code can run as a Java Virtual Machine (Java VM) on the machine code instructions. Each of the Java interpreter, whether it is Java development tools, or you can run Java applets in Web browsers, is a kind of Java VM instance. JavaVM can also be implemented in hardware.
Java byte code to make "write once, run anywhere" possible. Can be any Java platform compiler to compile Java byte code programs. This byte code can run on any Java VM. For example, the same Java program can run on WindowsNT, Solaris, and Macintosh on.
Platform is running a hardware or software environment. Java platform and most of the other platform The difference is that it is running on other hardware platforms, software-based platform. Most of the other platform is a combination of hardware and operating system.
Java platform consists of two parts:
Java Virtual Machine (Java VM)
Java Application Program Interface (Java API)
We have introduced the Java VM, it is based on Java platform can be ported to various hardware-based platforms. Java API is a collection of software components, they provide many useful features, such as graphical user interface (GUI). Java API is grouped into related components of the library (package).
The following diagram describes a run in the Java platform Java programs, such as application (application) or a small application (applet). Shown in the display, JavaAPI and the Java VM program separate from the hardware dependent.
As a platform-independent environment, Java code slower than native. However, smart compilers, well modulated real-time bytecode interpreter and compiler without sacrificing portability of Java's performance under the conditions close to local code.