consultancyfere.blogg.se

How is compiling java different from compiling c
How is compiling java different from compiling c













how is compiling java different from compiling c
  1. HOW IS COMPILING JAVA DIFFERENT FROM COMPILING C .DLL
  2. HOW IS COMPILING JAVA DIFFERENT FROM COMPILING C PORTABLE

The source code is the same, but the libraries are different on implementation side.

HOW IS COMPILING JAVA DIFFERENT FROM COMPILING C PORTABLE

It means that there are libraries that bind OS with those standard portable calls. It's not "cross-platform", it's portable. Nothing is cross-platform, except common standard library things, such as console and file I/O. Not just in names: OS calls do not have one-to-one correspondence. Now, all OS are different, so the compiled code is different. The problem here: where are the OS calls? Get back to the stage between compilation and linkage: they are the symbolic names of OS DLLs (shared objects, or something else) and function names. The code blocks, all calls, objects are shifted in sync with addresses referencing them, to fit in the memory the OS provides, code and data descriptors are set up. Each process gets its separate virtual address space using virtual memory. Then the third player comes up, the loader, the least known and most sophisticated part. Those addresses are still relative, only the symbols are eliminated. The linker takes the symbolic names and links them by addresses.

HOW IS COMPILING JAVA DIFFERENT FROM COMPILING C .DLL

Those files are put together in one executable code (DLL or EXE, it does not matter, this is just the PE file) by the linker. The code is created by a compiler and uses relative addressing and referenced to other parts of code, which are prescribed in the form of names (strings) in the binary obj or lib file.

how is compiling java different from compiling c

This code is not exactly the same as the code when it is executed by the process when an application is started. How do you think the applications work with OS? C++ and all languages addressing native platforms, compile to native code, writing native CPI instructions.

how is compiling java different from compiling c

You don't, so it's hard to explain, needs time and patience. To understand things, you need to understand all the operation from CPU to the application. Please see my last comment to the question, the one saying "I think I understand the confusion".















How is compiling java different from compiling c