2 ms·
It makes a ton of sense when working with identifiers, which is so common that it's almost the standard usage of java.util.Long. In most practical applications
by stickfigure 11y ago
It makes a ton of sense when working with identifiers, which is so common that it's almost the standard usage of java.util.Long. In most practical applications you can safely assume that identifiers are not going to use the full 64 bit range. And being able to pass them to javascript frameworks is incredibly useful - which is to say, the inability to use them in JS was incredibly frustrating with GWT.
- cromwellian 11y agoGWT 2.8 already does this. Long are passed as doubles unless they exceed 2^32. Also, Double and Boolean are now unboxed native values. And Object[] can be transparently passed to JS and back. Moreover, varargs work between JS and Java, maintaining the semantics of both sides to work correctly. If you want to build true hybrid apps that combine Java and JS programs, there's a lot more considerations that have to be made, we learned some hard lessons the last 3 years on Inbox, which is why JsInterop was redesigned 3 times to get the semantics sound.