Re: C++ to JVM compiler
On Apr 24, 2:03 am, Razii <whatever1...@hotmail.com> wrote:
On Thu, 24 Apr 2008 01:50:35 -0700 (PDT), "jhc0...@gmail.com"
<jhc0...@gmail.com> wrote:
Now that Java is going open-source again, I hope this project will be
resurrected. C++ and Java are the most widely used languages. It's a
shame that C++ can not be compiled to JVM, even though there is a ton
of platforms that it can be compiled to, and there is a ton of
languages that do compile to JVM.
http://nestedvm.ibex.org/
NestedVM provides binary translation for Java Bytecode. This is done
by having GCC compile to a MIPS binary which is then translated to a
Java class file. Hence any application written in C, C++, Fortran, or
any other language supported by GCC can be run in 100% pure Java with
no source changes.
Very interesting. Although, for C++ debugging, I don't think this
approach would always work for memory corruption detection, e.g.
#include <iostream>
struct pr {
double x;
double get_y() const { return y; }
pr() : x(0), y(0) {}
private:
const double y;
};
int main() {
pr p;
(&p.x)[1] = 3; // write to const private y
std::cout << p.get_y() << '\n';
}