本地库、本地代码、原生库、原生代码分别是什么意思?

2017-12-07 19:04:35 +08:00
 dtgio
经常听到或看到这些词,但是不清楚具体是什么意思。。
3637 次点击
所在节点    问与答
1 条回复
dtgio
2018-10-01 15:36:00 +08:00
https://searchmicroservices.techtarget.com/definition/native-code

Native 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 的中间语言可以在由即时编译器执行之前编译为本机代码,以提高性能。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/412900

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX