szatkus / js2me

J2ME implementation in JavaScript
MIT License
136 stars 29 forks source link

Is it possible to use actual java class files as native(library) classes? #14

Closed shnjm closed 2 years ago

shnjm commented 2 years ago

Hello @szatkus , This is a awesome project and you did great. Thank you for that.

I am interested to know if it is possible to use actual class files for CLDC & MIDP runtime and replace the JavaScript object approach in the /js/me folder. So that, use pure java classes and implement minimal interface using the JavaScript object approach to communicate with browser(canvas, sound, events etc.). Using this approach maybe it is possible to reuse existing java codebase and no need to implement everything in JS.

My concerns are,

  1. Is this approach possible?
  2. Is this approach require more resources and make the VM very slow?
  3. What are the possibilities and concerns?

Can you please provide some insights regarding this idea?

szatkus commented 2 years ago

One of the engines generates JS code from Java bytecode. It should be possible to built an AOT on top of that to generate stdlib from existing Java code if you have anything like this.

shnjm commented 2 years ago

That is interesting to me. Do you have any interest to implement and change current implementation for that?

You have provided so much efforts in the JavaScript object approach. I am not sure if it is okay to change the plan and redo everything now.

szatkus commented 2 years ago

Not really. The project is effectievely dead now.

shnjm commented 2 years ago

Okay, got your point. Maybe I can do some experiments before I lose interest.

Again, many thanks for your efforts and make them MIT licensed.

So I am closing the issue now. But always open to continue discussion(if any).