|Re: C++ -> Java VM compiler email@example.com (1997-01-12)|
|Re: C++ -> Java VM compiler firstname.lastname@example.org (1997-01-16)|
|Re: C++ -> Java VM compiler kuznetso@MIT.EDU (1997-01-17)|
|Why Virtual Machines? (was: C++ -> Java VM compiler) email@example.com (1997-01-25)|
|Re: Why Virtual Machines? (was: C++ -> Java VM compiler) firstname.lastname@example.org (Arch Robison) (1997-01-29)|
|Re: Why Virtual Machines? (was: C++ -> Java VM compiler) email@example.com (1997-01-29)|
|Re: Why Virtual Machines? (was: C++ -> Java VM compiler) Bronikov@srv2.ic.net (Dmitri Bronnikov) (1997-02-02)|
|[4 later articles]|
|From:||firstname.lastname@example.org (adam souzis)|
|Date:||12 Jan 1997 11:52:23 -0500|
|Organization:||A customer of Pacific Bell Internet Services|
|Keywords:||C++, Java, translator|
> this is a project id love to do, if I was a robo-coder
> 1. create a GNU g++ description for the Java virtual machine
> 2. write a portable library abstracting the classes awt etc.
> 3. recompile your C++ app/code to a .class.....viola!
> any takers, or interest in this project.
> especially if you have targeted G++ to a new processor, can inform me as to
> the feasibility of the idea?
As I understand it the Java VM is sufficently constrained to make that
a challenging proposition. Some C++ constructs such as pointer
arithmetic would be impossible to express in Java byte code. Other
constructs seem difficult but could probably be resolved through
various code generation techniques (for example the compiler could be
flattened out a multiple inheritance class hierarchy similar to the
way some Lisp systems deal with multiple inheritance).
If you look at the byte-code spec for Java (available on Sun's web
site), you can see that it is pretty different from a real processor's
machine code so my guess would be that it wouldn't fit to well into
GNU's back- end. In addition the Java VM validates the .class files'
byte-code further constraining the compiler's options.
Despite the difficulties I'd love to have a tool like this. I'm sure
no matter what, I'd have to re-write tons of my C++ code to get it
working in Java, but that's still better than having rewrite all of it
(in a new language)! Does anyone know of any research into this
matter? Considering how much C/C++ code there is out there, I'd
imagine it would be make a sucessful commercial tool.
Return to the
Search the comp.compilers archives again.