cincheo / jsweet

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

Add support for transpiling collections to ES6 #551

Closed iffyio closed 4 years ago

iffyio commented 4 years ago

This commit adds an Adapter that transpiles sets using ES6 Set implementation. The goal of the adapter is to use a standard API for the transpiled collections in order to abstract implementation details of collections as well as enable inter-operability between collections just as in Java. For example in Java most collections can be initialized with any arbitrary collection and never need to know how that collection is implemented.

Having the transpiled code work only via the API at collection boundaries enables this. However this means that collections transpiled by this adapter are not compatible with those transpiled by other adapters - this should be less of an issue once the adapter has support to handle all collection types.

Related #548 Fixes #549

iffyio commented 4 years ago

@lgrignon let me know if you have any thoughts on whether this approach is viable, potential issues etc

lgrignon commented 4 years ago

Very nice, thank you very much!

FYI I am currently working on this: https://github.com/cincheo/jsweet/issues/519 This is amazing. We may need help at some point if you are still interested :)