Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

escritorio-gustavo
Copy link
Contributor

Goal

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

Checklist

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

@escritorio-gustavo escritorio-gustavo added bug Something isn't working breaking change This PR will change the public API in some way labels Apr 19, 2024
@escritorio-gustavo escritorio-gustavo removed the bug Something isn't working label Apr 30, 2024
@NyxCode
Copy link
Collaborator

NyxCode commented May 17, 2024

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?

@escritorio-gustavo
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This PR will change the public API in some way
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usize and isize should be typed as bigint on 64-bit architectures
2 participants