Ann said:
Is it not true that of the Java byte codes produced
some are general purpose, but many are Java specific?
I've said this before, but I'm just about to say it again ;-)
The bytecodes understood by the JVM constitute a high-level OO programming
language. In fact the language (except for it's machine-oriented "syntax" --
binary bytecodes) is fairly similar to Java, although in several ways rather
more rather higher-level. The language features objects, classes, interfaces,
methods, static members and primitive types. It also features strong static
and dynamic typing (with rather more emphasis on dynamic typing than
Java-the-language, which is one reason I characterise it as rather higher
level).
All in all, the resemblance to Java is strong enough that (if you ignore the
new fluff that has been added to Java-the-language) the job of javac is better
thought of as mostly just /translation/ than compilation as it's usually
understood.
Any compiler for another language that is producing bytecode for JVM will be
doing much the same kind of work as it would if it were intended to produce
Java code as output. The difficulty of that will depend on how naturally the
concepts of the language map into "normal" Java OO programming (and on how
badly the type checking gets in the way, but that's another story).
-- chris