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

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

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

Post by KanedaFr » Tue Nov 24, 2015 12:27 am

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

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

Post by Stef » Tue Nov 24, 2015 9:41 am

Haha, that is a awesome discover ! Thanks for pointing it :D

tryphon
Very interested
Posts: 316
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

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

Post by tryphon » Tue Nov 24, 2015 9:51 am

It's undoubtly awesome and quite impressive but...

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

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

Post by Stef » Tue Nov 24, 2015 10:49 am

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)

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

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

Post by Mask of Destiny » Tue Nov 24, 2015 6:22 pm

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

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

Post by Stef » Tue Nov 24, 2015 6:59 pm

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.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

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

Post by Mask of Destiny » Tue Nov 24, 2015 8:22 pm

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.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

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

Post by Stef » Tue Nov 24, 2015 11:03 pm

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.

elefas
Newbie
Posts: 5
Joined: Sun Jan 30, 2011 11:28 am

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

Post by elefas » Sat Dec 19, 2015 8:19 pm

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!

Post Reply