Skip to content

u32/u64 <--> int32/int64: dangerous to allow? #130

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

Open
dannywillems opened this issue May 10, 2023 · 1 comment
Open

u32/u64 <--> int32/int64: dangerous to allow? #130

dannywillems opened this issue May 10, 2023 · 1 comment

Comments

@dannywillems
Copy link

The doc says u32 (resp. u64) is mapped to int32 (resp. u64). Is it not dangerous to allow this regarding overflow? Should it be mapped to a non native Caml value like done (though using an indirection) in ocaml-integers?

@zshipko
Copy link
Owner

zshipko commented May 17, 2023

Yeah, i think this is a situation where we've chosen to prioritize usability at the expense of some safety. In cases where you are concerned about overflow it makes sense to create a custom type that holds the Rust u64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants