It so happened that I worked a lot on C / C ++ and did not work on Java. And now, I see, for mobile platforms, Java is very much in demand. I, as a reasonable-lazy person, want to avoid a full study of Java. I would still like to write in C ++, but in order to translate C ++, the code is not in native code, but in code for a Java machine.
Question:
- Are there technologies now, where C ++ - the code is translated not into the native code for a specific platform, but into the code for a Java machine? So that later this code was executed as Java code on a Java machine on any platform.
UPD1:
In my opinion, Java code is now being translated into some intermediate code for an abstract Java machine. On different platforms there is a JIT-translator, which, when running this code, translates it into native code for this platform and launches it. Or am I wrong?
UPD2:
It seems to be something easier. Take the GCC translator, leave the parser and instead of the code generator for the x86 platform write a code generator for the Java machine. Has nobody made such a hybrid yet?
UPD3:
Then the second question related to the first:
Question:
- How are Java programs distributed? Are Java programs distributed in source code, or are Java programs distributed in code for a Java machine?