gcc backend that can be interpreted by a java program?

Ranjit Mathew rmathew@hotmail.com
Mon Jul 7 05:05:00 GMT 2003


> Adam> Why? I need to run Freetype2 (very clean ANSI C, no external
> Adam> dependencies) in an all-Java environment. JNI/CNI are not an option.
>> I think there's an MMIX back end around somewhere. This is a fake
> assembly language invented by Knuth. Dunno how hard it would be to
> write a simulator for it. That's my best guess for this sort of
> thing.

MMIX is described fairly well in:
 http://www-cs-staff.stanford.edu/~knuth/fasc1.ps.gz
 http://www-cs-staff.stanford.edu/~knuth/mmix-doc.ps.gz
 http://www-cs-staff.stanford.edu/~knuth/mmixal-intro.ps.gz
 http://www-cs-staff.stanford.edu/~knuth/mmix-sim-intro.ps.gz
The MMIX target for GCC is described at:
 http://bitrange.com/mmix/gcc/
*However* MMIX is hardly simple, contrary to what Knuth
claims (IMHO). In any case, a simulator for MMIX is
available at:
http://www-cs-staff.stanford.edu/~knuth/programs/mmix-20030622.tar.gz
As far as I know, TrueType itself needs to be interpreted
to draw the glyphs - so Adam, you'd end up interpreting
the interpreter that interprets TrueType instructions. :-)
I don't know why you can't use JNI/CNI, but IMHO porting
FreeType2 might not be much tougher than the alternative
you are proposing.
> It would be possible to compile C to java bytecode with a lot of
> runtime support. Per had a plan for this some years back, though we
> might not have ever released it.

A few years ago:
 http://gcc.gnu.org/ml/java/1999-q2/msg00006.html
Per answered this, saying that:
[...]
"Gcc does assume it can do pointer arithmetic. In Java bytecodes,
you can't, at least not in the same way.
We have thought about make a true back-end for the "Java instruction
set". My feeling is that this might make sense for a Java chip,
where the native instruction set is the Java opcodes (possibly
extended), but probably not for other machines. For one thing,
there are practical complications in building and installing
two backends (native and jvm) for a single architecture."
Ranjit.
-- 
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /