Eric wrote:
On Nov 27, 12:38 am, David Schmenk <dschm...@YUCH.gmail.com> wrote:As soon as I finish working out some issues with the garbage collector (I don't like automatic garbage collectors) I should have something to try out.I assume you've studied NanoVM. That takes a lot of liberties that work great on a small machine but wouldn't (or couldn't) work well on a larger machine. The way he uses the high bit of an integer or object reference to indicate whether it needs to be collected is both ingenoius and perhaps dangerous. You then have only 15 bit integers instead of 16 bit integers and that can lead to buggy code.
It is clever. Trying to tag which memory needs to be collected is turning out to be one of the hardest things to do in a space and time efficient manner.
To me the huge elephant in the room is not the VM or the garbage collector, but rather the class libraries. Java developers are used to a lot of baked-in classes and methods and it's going to frustrate them if you only have a small subset, such as that offered by NanoVM.
There is a subset of the classes which make sense for this project as defined for the KVM. If I were to try and replicate the full Java class libraries I'd never get done.
I don't think a discussion of performance of this Java dialect against Apple Pascal is particularly relevant. I don't see these as competitors. There are very few Apple Pascal developers left, based on my unscientific observation from the newsgroups. And the number of people who really want to play with Java on the Apple II may also be small. Many Apple II fans grew up before the days of OOP coding and they probably wouldn't see much reason to use Java.
Only in that USCD Pascal and Java are direct relatives and Pascal ran on the Apple II. I think the 6502 p-code interpreter sets a reasonable baseline for performance - it runs acceptably fast and implements a self-contained working environment on the machine. A JVM should strive to meet these goals as well, or as Oliver found out, its not really useful. NanoVM isn't a viable project for the Apple II.
But I don't want to be pessimistic because I share your enthusiasm in the final project. It would be sweet, and almost a sin against nature to take a super modern language and back-port it to work on a machine that wasn't even sold any more before the first discussions of Java ever showed up in its earliest form. There's also a little bit of "take that, Mac" payback involved here :-) Eric
I can think of no better reason to do it - except to hook up a Java programed NadaNet supercomputer ;-)
Dave...