In a language that uses the JVM, say Jython, JRuby or any language that isn't Java specifically, is Java the language being used "underneath" somewhere?
Does the implementation mean:
Language Ported to use the JVM + Java somewhere + JVM?
For example, was Jython written in Java or does it using something else to utilize the JVM?
It depends.
Part of language's standard library may be implemented in java. Ditto for the compiler/interpreter. Other parts that are not essential for bootstrapping may even be written in the language itself.
The user code itself initially may be run through an interpreter but later compiled to bytecode. Additionally the generated bytecode may be optimized further based on type profiles gathered during runtime. And the bytecode may bail out back to the interpreter if some of its assumptions are invalidated. This is analogous - albeit at a higher abstraction level - to hotspot's interpreter/c1/c2 tiers and many other JIT environments.
But interpreter+JIT is just one possible approach. Scala for example is AOT-compiled to bytecode.
And they may also use C bindings to implement functions of the respective language's standard library that have no 1:1 mapping to the JDK standard library.
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