harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Griffiths <david.griffi...@gmail.com>
Subject Third Way - implement the JVM in a new C/Java hybrid
Date Fri, 13 May 2005 10:51:02 GMT
No, but seriously. :) I agree that C sucks as a JVM implementation
language for lots of reasons: the Java/C impedance mismatch, the lack
of ability to aggressively inline (which will be a big issue if you
every try to achieve real modularity), poor trace/debug/profiling
ability (wouldn't it be nice to have a coherent view of where your
time was being spent?).

The idea of implementing it in Java sounds nice except for all the
tricks you have to do to get round the infinite recursion problem.

So why not invent a new language that is a kind of half way house
between C and Java? It will be dynamically compiled just like Java but
won't come with a lot of the other stuff like GC and threading.
Instead it will have raw access to the platform system calls. Plus
some kind of support for C style memory pointers. The same compilation
engine would compile both the JVM parts written in this language plus
suitable converted Java bytecode.

I don't think inventing the language and writing a parser for it is
the hard part (it's pretty much Java-- with a dash of C), the hard
part is doing the optimising back-ends for all the different
platforms. But you've got to do that anyway unless you go the GCJ

If it's possible to write a JVM in Java (as has been demonstrated)
then it's surely even easier to implement it in a purpose built
language. Such a language might have other system programming type
uses. Lots of existing JNI code could be converted to it.

Well that's just another thought in case you were in danger of
reaching a consensus. :)



View raw message