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

int on 32bits #31

Closed
athaa opened this issue Mar 18, 2019 · 3 comments
Closed

int on 32bits #31

athaa opened this issue Mar 18, 2019 · 3 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@athaa
Copy link

athaa commented Mar 18, 2019

Hello

In V, the type int is an 32bits number on every plateform. What is the point ?

Doing this you risk to suffer bad performance on some architecture (or at least not using some optimization).
If the user really need 32 bits, il will use the type i32/u32.

Il you are afraid of random integeroverflow on some plateforme (tested on a 64 bits CPU, runned on a 32 bits CPU), I guess you could add a compiler option to force the 32bits size int. Or force this behaviour only when running the test.
You could also consider adding type safe_int to fix this issue.

@medvednikov
Copy link
Member

Consistency and predictability.

@athaa
Copy link
Author

athaa commented Mar 18, 2019

I got you're point but in most programme,
for i := 0; i < 10; i++ {
will be one of the main usage of integer (after storage), It' a shame to not optimize this usage case.
But you're right a trade off is necessary. It's all about what's your top priority.

@athaa athaa closed this as completed Mar 18, 2019
@erdian718
Copy link
Contributor

type int should be removed.
There is no different between int and i32, why we need tow way to do the same thing?

@medvednikov medvednikov added the Bug This tag is applied to issues which reports bugs. label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

3 participants