Related articles |
---|
How to translate a language that runs on JVM? jrefactors@hotmail.com (2005-01-03) |
Re: How to translate a language that runs on JVM? sgganesh@gmail.com (2005-01-09) |
Re: How to translate a language that runs on JVM? holycall@paran.com (Seokwoo Choi) (2005-01-09) |
Re: How to translate a language that runs on JVM? vbdis@aol.com (2005-01-09) |
Re: How to translate a language that runs on JVM? news8573@paulcager.com (Paul Cager) (2005-01-09) |
Re: How to translate a language that runs on JVM? napi@cs.indiana.edu (2005-01-12) |
Re: How to translate a language that runs on JVM? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-01-12) |
Re: How to translate a language that runs on JVM? pohjalai@cc.helsinki.fi (A Pietu Pohjalainen) (2005-01-12) |
Re: How to translate a language that runs on JVM? caseyh@istar.ca (Casey Hawthorne) (2005-01-14) |
From: | A Pietu Pohjalainen <pohjalai@cc.helsinki.fi> |
Newsgroups: | comp.compilers |
Date: | 12 Jan 2005 22:55:58 -0500 |
Organization: | University of Helsinki |
References: | 05-01-012 05-01-016 |
Keywords: | Java, translator |
Posted-Date: | 12 Jan 2005 22:55:58 EST |
sgganesh@gmail.com wrote:
> There are many portions in .class file format that makes writing
> translators for other versatile languages to JVM difficult, if not
> impossible. For example, consider directly translating C++ programs to
> .class files: things like not having support for multiple inheritance
> are obvious reasons, but there are many subtle language features, for
> example, how const and final are treated in C++ and Java; also the
> runtime allocation and memory models aren't just compatible.
Writing a C++ compiler targeting to JVM would be difficult (well,
writing such a compiler is difficult in case of any backend), but not
impossible. The discussion above applies to the .net-platform as well;
the type system doesn't have support for multiple inheritance, but still
there are compilers for languages (C++, Eiffel) that require multiple
inheritance, targeting to that platform.
I believe that the trick on implementing multiple inheritance on
presence of single inheritance is to implement a type system private
to the compiler instead of using the platform provided one. This
information is based on John Gough's book 'Compiling for the .NET Common
Language Runtime (CLR)', pages 349-352.
br,
Pietu Pohjalainen
Return to the
comp.compilers page.
Search the
comp.compilers archives again.