I’m doing numerical intense applications where I use arrays that require indices > I32.
Ruby doesn’t have this index restriction, but it takes way more time to run.
So I want to create my own Custom Crystal, to increase the index sizes (bitarrays too) to I64.
-
What source files would I need to change to do that?
-
How do I compile my Custom Crystal afterwards.
You don’t need a custom Crystal for this.
It should be relatively easy to copy the source code of Array and create a new type with 64-bit sizes (Array64?) based on that. Also need to copy a few modules like Enumerable, Indexable.
But no big changes required, just switch all sizes and offsets from Int32 to Int64.
OK, great! Would I then have to recompile Crystal to include these new versions or just require their versions into my apps?
You just require the files with the new class in it, or you monkey-patch the existing Array to do what you need.
Better: just adapt your code to split the data into multiple sanely sized arrays rather than allocating (and worse reallocating) insanely large arrays.