# Int32 limit for the number of Array elements

**URL:** <https://forum.crystal-lang.org/t/int32-limit-for-the-number-of-array-elements/2405>\
**Category:** Help & Support\
**Created:** [August 2, 2020, 3:11am UTC](https://forum.crystal-lang.org/t/int32-limit-for-the-number-of-array-elements/2405 "2020-08-02T03:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makino](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/makino/32/1019_2.png) [@makino](https://forum.crystal-lang.org/u/makino)\
**Post date:** [August 2, 2020, 3:11am UTC](https://forum.crystal-lang.org/t/int32-limit-for-the-number-of-array-elements/2405/1 "2020-08-02T03:11:48Z")

</div>

I know this has been discussed some years ago

> <https://github.com/crystal-lang/crystal/issues/4011>
>
> arr = Array(UInt8).new(2147483647,1u8)
> arr \<\< 2\_u8
> arr.size #=\> -2147483648
> This could be a very surprising behaviour to run across. Ideally an error should be...

But does it really make sense to limit the array size to Int32::MAX?  
Applications in bioinfomatics, data sciences, and High-performance  
computing do need larger arrays (and large memory). Int32 limit in  
2020 sounds too much like “640K ought to be enough for anybody” in  
1981…

---

<div class="post-metadata">

**Author:** ![girng](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/girng/32/127_2.png) [@girng](https://forum.crystal-lang.org/u/girng)\
**Post date:** [August 2, 2020, 8:28am UTC](https://forum.crystal-lang.org/t/int32-limit-for-the-number-of-array-elements/2405/2 "2020-08-02T08:28:55Z")

</div>

Can you do an Array of Int64s?

---

<div class="post-metadata">

**Author:** ![asterite](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/asterite/32/60_2.png) [@asterite](https://forum.crystal-lang.org/u/asterite)\
**Post date:** [August 2, 2020, 12:22pm UTC](https://forum.crystal-lang.org/t/int32-limit-for-the-number-of-array-elements/2405/3 "2020-08-02T12:22:07Z")

</div>

Yes, this has been discussed in the past. I recently made an attempt to make `Int` be a type that varies depending on the platform, and then making collections have that size. But it’s a huge task and, most importantly, it’s a huge breaking change.

Nothing of this is going to change for 1.0. For 2.0? Maybe, but it’s not clear.
