cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 160 forks source link

Consider supporting a larger (but still small) part of the JRE #87

Closed ivmarkov closed 8 years ago

ivmarkov commented 8 years ago

I understand that the philosophy of jsweet is to rely on existing JavaScript libraries as much as possible, however having at least some classes from the JRE would be hugely beneficial e.g. for code-sharing with the server, and overall for winning the mindset of Java developers.

I mean, at least a subset of the Java Collections API being available would be hugely beneficial.

GWT/J2CL does support a reasonable set of the JRE. Basically, a subset of java.lang and java.util: http://www.gwtproject.org/doc/latest/RefJreEmulation.html

Supporting (a subset of) the GWT/J2CL JRE would also enable an easy migration path for developers migrating away from GWT to jsweet.

ivmarkov commented 8 years ago

Forgot to mention that the GWT/J2CL JRE subset is licensed under Apache 2, so re-using large parts of it is at least (legally) feasible.

On the technical front, I think they are getting rid of the older JSNI Java<->JavaScript interop (based on JavaScript embedded in Java comments around native methods!) because it is not supported by J2CL. They are now switching to the new "JSInterop" thing which - while not identical to the the jsweet Java<->JavaScript interop, is much more similar to it...

renaudpawlak commented 8 years ago

I am currently working on a first implementation of Java collections. It is almost ready but requires a little of work before going public. It will of course fully preserve the JSweet philosophy and will be completely independent from it.

ssatguru commented 8 years ago

nice !

renaudpawlak commented 8 years ago

Hi guys! You may be interested in this post, which presents our new J4TS project... it is the root of some Java API support :D

http://www.jsweet.org/jsweet-strives-for-javatypescript-interoperability/