Page 1 of 1

After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 12:27 am
by KanedaFr
If you miss it, a (wonderful ? totally mad ?) guy made a Java compiler...for Genesis !

Don't know about the fps but it works !

More info here

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 9:41 am
by Stef
Haha, that is a awesome discover ! Thanks for pointing it :D

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 9:51 am
by tryphon
It's undoubtly awesome and quite impressive but...

why on Earth did it have to be Java ???

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 10:49 am
by Stef
Java is not that bad :p
I'm doing java programming at my professional position and definitely i do like this language.
Very easy and fast programming, efficient JIT compilation allowing comparable performance with C++ code but *far* easier to maintain.
If i could code on Megadrive in java, i would do it, unfortunately this is some limitation on java which prevent 100% development in java (or you have to use the Unsafe package which almost kill purpose of java)

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 6:22 pm
by Mask of Destiny
Obviously anything that directly bangs on the hardware would need to use the unsafe package (or JNI I suppose), but if you encapsulated those parts most of your code could have normal safety guarantees. Not sure how practical a garbage collector is on a system with only 64KB of RAM though and it seems that at least for now that is something this guy's code leaves out.

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 6:59 pm
by Stef
Yep, he's just taking the java byte code and convert it to 68k assembly... so you don't have the JVM features as GC.
At least you can use the neat java syntax and OO programming paradigm, also i guess the byte code is already quite optimized, probably even better than what GCC can does.

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 8:22 pm
by Mask of Destiny
GCC's 68K output is not the best, but I would guess this is even worse. My impression is that javac does not go to a lot of effort to optimize the Java bytecode, both because it's output is somewhat high level and because the assumption is that the JIT is in a better position to do optimization since it has runtime-only information (i.e. how many different targets does this virtual call site actually have in practice). The Java VM is also stack based. It's certainly possible to do a reasonable static compilation of Java bytecode to a 68K target, but it's definitely a non-trivial amount of work.

Re: After ASM, C, Basic...here comes Java !

Posted: Tue Nov 24, 2015 11:03 pm
by Stef
JIT does most of the work but i still think the byte code is already nicely optimized so the JIT just have to apply the target runtime specific optimizations.

Re: After ASM, C, Basic...here comes Java !

Posted: Sat Dec 19, 2015 8:19 pm
by elefas
Hello all,
Just wanted to bump this thread because recently I discovered Mike's work on java grinder and it's mega drive implementation. I believe his work is awesome as he gives the homebrew community another tool to code demos and games. Plus he is a great guy, we exchanged a couple of emails asking him if he planned to add gamepad support to his code, and voila, today he already committed control functions to his github repo!

Definitely I will try out coding some Java for my Sega, I hope the community here will also give it a shot, it's worth it!