Typical Java Applet Structure
-
Java Source ---> javac compiler --> JavaVM Universal machine code in .class file
-
Store JavaVM .class files on Web Server
-
Download JavaVM from Server to Client.
-
Interpreter built into browser, reads JavaVM and executes on client
|
Typical JavaScript Structure
-
JavaScript source is included in HTML text
-
Combined JavaScript and HTML is downloaded and interpreted by browser on client to produce HTML page
-
Particular user actions on HTML page (e.g. mouse clicks and form entries) can invoke JavaScript functions on the client
-
As browser one must "understand" raw high level language, this is substantially slower than interpreting JavaVM where "just" need to map universal machine code into machine code for a particular computer
|
Note in each case , Java and JavaScript use "runtime" which is "compiled high performance library" (probably written in C and C++)
|