Home android What is native code?

What is native code?

Author

Date

Category


Answer 1, authority 100%

The concept of native code is code that is supplied by the developers of something. For example, all the code in the Java SDK for Android is considered native. All third-party libraries are gone.


Answer 2, authority 25%

There is not enough information in one word “native”. Clarification needed: who is native to?

  • For the JVM, native code is bytecode, native language is Java (and others).
  • For Windows, native code – Portable Executable, native language – C++, Delphi, etc.
  • For x86 processor, native code is x86 instructions, language is assembler.

etc. Many modern applications run on a “puff pie” of platforms: for example, an application written in Java runs on a JVM, which in turn can run under (or above?) Windows, which runs on an x86 processor. Each layer has its own native code. Code from another layer will not be native to it, for example, Java code for Windows is not native.

Native language – a language for which there is a compiler to native code (for a given platform).


Answer 3, authority 8%

Going to the Wiki

In computing, software or data formats that are native to a system are
those that the system supports with minimal computational overhead and
additional components. This word is used in such terms as native mode
or native code.

Something running on a computer natively means that it is running
without any external layer requiring fewer software layers. For
example, in Microsoft Windows the Native API is an application
programming interface specific for Windows NT kernel, which can be
used to give access to some kernel functions, which cannot be directly
accessed through a more universal Windows API.

Runtime-native code / language / API / Data format, etc. – this is the one that is understood by the default runtime, without complex add-ons. There is no absolutely clear definition – there is a kind of “generally accepted” understanding that can differ from person to person.

For Windows, for example, the native is executable code in the .exe (or .com ) file format that works directly with the Win API. For Unix systems, binaries are native (and, also, shell scripts all of a sudden), for JVM, the .jar (not only) file is native. Those. if quite simply, then the native code is the one that you fed to the runtime installed out of the box (double click on the .exe file in Windows) and it was executed without cursing that it lacks libraries or frameworks.

Native language is an even more streamlined definition. It is possible, with reservations, to assume that a platform-native language is a language for which the platform manufacturer has created a development environment / compiler into native code and which they officially declare support in the documentation.

PS A good analogy came to mind. The level of knowledge of a foreign language is determined by examinations on it with an assessment: A1, A2, B1, B2, C1, C2. But there is one more level of language proficiency – native . It means that a person has been living in a given linguistic environment since childhood, speaks it and thinks (!) In it. The level of native does not indicate a person’s literacy, often native knows the rules of the language worse, often makes mistakes in grammar and punctuation than C2, but for him it is Native .


Answer 4

If a jit compiler or an interpreter is not required to run what the program is compiled into, then it is compiled into native code.

  • Java bytecode and .net il-code are not native.
  • C++ programs are compiled into native code.
  • VB6 programs can be compiled to both native code and P-code.

Answer 5

Native code is code that is not executed by a third-party (not preinstalled on the OS) interpreter, as is the case with C #, Java, Python, etc.

The Java language for windows is not native, since the JVM must also be installed on Windows.
But on android, Java is native, because the JVM is there initially and all applications use it.

For Android Java, Kotlin

For iOs Obj-C, Swift

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions