Question for the team (and I know I already asked ...
# javascript
e
Question for the team (and I know I already asked about this a while back, sorry): what's the status of exportability for unsigned numbers? I actually found quite a challenging issue while building an interoping layer with our mainframe programs, which mostly use unsigned numeric types. It would be nice to represent them in the same way as the C programs.
a
So, we have a draft design for them and plan to support it (but I don't believe that we will manage to do that till 2.3.20 release). Please, tell me more about your idea of representing unsigned numbers.
e
@Artem Kobzar ah, nice! The current problem we have is we are deserializing bytes representing whole 4-bytes integers, for example, without sign. To accommodate such values in Kotlin, we are forced to use
Long
and to export them as
bigint
, and then convert them again to
number
for easier consumption. If instead we were to use
UInt
, we could deserialize to
UInt
and export it as
number
directly, since JS's
number
correctly support the unsigned integer max value.
Using
UInt
in the Kotlin layer also aligns to the "backend", and we're not forced to ask ourselves "is this a
Long
because it's really a long value, or just to support the unsigned range?".
Note that we are in a multiplatform context, where we also have a JVM and mingwx64 implementation. So I can't assume
Int
is just a JS
number
under the hood.