https://searchmicroservices.techtarget.com/definition/native-codeNative code is computer programming (code) that is compiled to run with a particular processor (such as an Intel x86-class processor) and its set of instructions. If the same program is run on a computer with a different processor, software can be provided so that the computer emulates the original processor. In this case, the original program runs in "emulation mode" on the new processor and almost certainly more slowly than in native mode on the original processor. (The program can be rewritten and recompiled so that it runs on the new processor in native mode.)
Native code can also be distinguished from bytecode (sometimes called interpreted code), a form of code that can be said to run in a virtual machine (for example, the Java Virtual Machine). The virtual machine is a program that converts the platform-generalized bytecode into the native code that will run in a specific processor. Microsoft's .NET compilers for its Visual Basic, C#, and JavaScript languages produce bytecode (which Microsoft calls Intermediate Language). Java bytecode and Microsoft's Intermediate Language can be compiled into native code before execution by a just-in-time compiler for faster performance.
本机代码是计算机编程(代码),编译为与特定处理器(例如 Intel x86 级处理器)及其指令集一起运行。如果在具有不同处理器的计算机上运行相同的程序,则可以提供软件以使计算机模拟原始处理器。在这种情况下,原始程序在新处理器上以“仿真模式”运行,并且几乎肯定比原始处理器上的本机模式慢。 (该程序可以重写并重新编译,以便它以纯模式在新处理器上运行。)
本机代码也可以与字节码(有时称为解释代码)区分开来,字节码是一种可以说在虚拟机中运行的代码形式(例如,Java 虚拟机)。虚拟机是一个程序,它将平台通用字节码转换为将在特定处理器中运行的本机代码。微软用于 Visual Basic,C #和 JavaScript
语言的.NET 编译器产生字节码(微软称之为中间语言)。Java 字节码和 Microsoft 的中间语言可以在由即时编译器执行之前编译为本机代码,以提高性能。