ts-rs icon indicating copy to clipboard operation
ts-rs copied to clipboard

i/usize types should generate bigint when in 64-bit systems

Open escritorio-gustavo opened this issue 1 year ago • 3 comments

Goal

Export bigint for usize, isize and their NonZero counterparts when in a system with 64-bit pointers Closes #311

Checklist

  • [x] I have followed the steps listed in the Contributing guide.
  • [x] If necessary, I have added documentation related to the changes made.
  • [x] I have added or updated the tests related to the changes made.

escritorio-gustavo avatar Apr 19 '24 18:04 escritorio-gustavo

I'm really unsure about this.
For the use-case I most often have in mind - JSON APIs - this would be super weird, since there's no correlation there.

Am I missing something here?

NyxCode avatar May 17 '24 19:05 NyxCode

This is kind of part of the debate going on in #94 about number/bigint. Since we consider numbers with 64+ bits as bigints #311 argues we should also consider i/usize as bigints on systems with 64 bit pointers

escritorio-gustavo avatar May 20 '24 11:05 escritorio-gustavo

This does affect JSON APIs, the creator of #311 commented that his API attempted to send a usize to the frontend, which failed to parse it because JS numbers can't handle usizes, causing a runtime error

escritorio-gustavo avatar May 20 '24 11:05 escritorio-gustavo