Created: 2023-08-22 21:54
Status: #concept
Subject: Programming
Tags: Compiler Linking Java JavaScript
Bytecode
They are object code, similar to C's
.o
files, which an Interpreter can convert into Binary Machine Language in order to be ran by the computer.
-
In Java, the Java Virtual Machine can interpret the bytecode according to the CPU Architecture, which allows portability.
-
In JavaScript's V8 Engine, code can be scanned at runtime for optimizations and can have "Just in Time" (JIT) compilation into bytecode when certain conditions are met, otherwise it is mostly interpreted straight from JavaScript.
Java Compilation & Execution Steps
- We write our code with Java into
.java
Source Code files. - We use the JDK Compiler to transform our code into
.class
Bytecode. - The Java Virtual Machine interprets the
.class
Bytecode and translates the instructions to the current system's CPU Architecture's Binary Machine Language. - The code is executed.