[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Java on the Apple2 and C64
On Aug 10, 2:21 am, mdj <mdj....@gmail.com> wrote:
> Well really, the JVM isn't that far removed from the UCSD p-System it
> was (partly) inspired by.
That's true. The main differences are automatic garbage collection and
OOP support. Otherwise the basic concept of the JVM builds directly on
the p-System ideas.
> The degree of inefficiency implied by the
> degree of indirection inherent in object oriented programs probably
> implies that the paradigm has little practical use on such a small
> machine, whether bytecode interpreted or not.
It's certainly going to be slower than using cc65 directly, but this
is due mostly to the inefficieny of the VM layer and not really
because of the OOP. Static functions in Java don't require object
instances, so you don't always have to live with indirection of each
object. Static member invocation is about 10 times faster than
instance invocation in general, but once you factor in the time it
takes to do the processing in the function it can swamp the overall
benchmark numbers. We rarely call empty functions.
In all honesty, this is most practical in the sense that it's cool!
This is not going to win any converts who already use native code
compilers or assemblers. But it's possible that it might compete in
benchmarks with Applesoft. I would not try to "sell it" based on that,
of course. And I wouldn't bet the farm that it's going to be faster
than Applesoft.
Something we haven't mentioned yet is that the real power in Java is
not in the language itself, or even the JVM. It's the wide-spanning
class libraries that make Java kick butt because you can leverage
thousands of lines of code written and debugged by other people. And
NanoVM does NOT include those huge class libraries. We clearly won't
be able to have a full Java environment for the Apple 2.
The mere fact that you can run simple Java programs on an Apple is
exciting. And the Apple can even serve as a devlopment platform for
Java programs that run on the small microcontrollers.
Eric