[1485] in java-interest
Re: Systems Programming Oriented Java
daemon@ATHENA.MIT.EDU (sbk@netcom.com)
Tue Sep 5 23:14:43 1995
From: sbk@netcom.com
To: java-interest@java.sun.com
Date: Tue, 5 Sep 1995 17:18:39 -0700 (PDT)
Cc: sbk@netcom.com ()
Chuck McManis writes:
]
] Don't confuse the bytecode interpreter with Java. Think of the interpreter
] as a chip, a piece of hardware. Would you expect that the design of the
] SPARC chip was written in C because the OS you were going to run on that
] chip was to be written in C ? I wouldn't, I'd still define the chip in
] VHDL since that is more amenable to expressing the hardware. The "interpreter"
] is just the Java CPU. And I would like it to be so concretely specified that
] I could implement it just once in native assembly code and then treat it
] like a black box. However for portability reasons we stick to C.
]
Just to play the devil's advocate here to help me understand some of
this stuff (ie please don't flame me if I'm clueless :-)
1. If C is adequate to specify/implement a java VM, wouldn't Java, being
a better systems programming language and all, be better?
2. *Java bytecode* ought to be the portability medium, not C.
Correct me if I'm out of my depth on this, but for instance, does it
look like the current (Alpha 3) interpreter on Solaris makes enough
assumptions about structure alignment that I can't simply run gcc on
the same piece of C on the same platform and get correctly working
code?
So I'm wondering if it is more portable to implement large portions of
the VM in Java, and bootstrap it by translating the byte code for the
VM into C. The assumption is that since the bytecode manipulates
comparatively simple data types, the resultant C code is more portable
than writing the entire VM in C.
The second aspect to this is that it would also quickly expose any
hooks that are required to be provided by the VM outside of what the
specification says a VM needs to do.
For instance, many methods require the VM to tell them the state of
the stack (is there a class loader on it?). There is no byte code to
accomplish this task, so it is implemented by using a hook into
the VM data structures.
-KB-
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com