I have been hearing a lot lately regarding Scala, Clojure, etc which is supposed to run on JVM. Does this means that those languages are implementing the Java API underneath? What does it mean for a language to run under JVM?
Thanks.
A JVM language is any language with functionality that can be expressed in terms of a valid class file which can be hosted by the Java Virtual Machine. A class file contains Java Virtual Machine instructions (Java byte code) and a symbol table, as well as other ancillary information.
The JVM was initially designed to support only the programming language Java. However, as time passed, even more languages were adapted or designed to run on the Java platform.
The JVM can "run" other programming languages because it can "run" any programming language, because it is Turing complete.
One of the biggest reasons why Java is so popular is the platform independence. Programs can run on several different types of computer; as long as the computer has a Java Runtime Environment (JRE) installed, a Java program can run on it.
It means that these languages can be compiled into Java bytecode, which the JVM executes.
It means that the language compiles down to JVM byte code at some point. The language doesn't need to implement the Java API; the Java API is already there (more or less all the time).
It just means if you have a JVM you should be able to run the language without another VM (although you'll need whatever class files the language compiler and libraries need, obviously).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With