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

Consistent support for 32-bit/64-bit integer types #758

Open
mehalter opened this issue Mar 31, 2023 · 1 comment
Open

Consistent support for 32-bit/64-bit integer types #758

mehalter opened this issue Mar 31, 2023 · 1 comment

Comments

@mehalter
Copy link
Member

In a lot of the code in Catlab we have methods that define parameters as Int rather than Integer. Int will be converted to Int32/Int64 based on whether or not it's on a 32-bit or 64-bit machine. If we change all of these to Integer then it will generalize to integers of any bit size.

Basically on a 64-bit machine if you decide to use Int32 anywhere we won't be able to use any of the Catlab internal functions because there won't be functions defined for Int32

@mehalter mehalter added the bug label Mar 31, 2023
@epatters epatters changed the title Generalize methods for 32/64 bit operations Consistent support for 32-bit/64-bit integer types Apr 2, 2023
@epatters
Copy link
Member

epatters commented Apr 2, 2023

I take your point, but I'll note that a proper fix involves more than just replacing Int with Integer in method signatures. Our combinatorial data structures (acsets) would need to be generalized with an extra type parameter T<:Integer specializing the integer type and this would need to be propagated through constructors, as well as supplemented with suitable default constructors.

It's certainly possible to do this. Graphs.jl does it, for example. But for me it's not so much a bug fix as a deliberate design decision whether the extra boilerplate is worth it. My guess is that nothing will happen until someone shows up with an HPC use case where it actually matters.

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

No branches or pull requests

2 participants