Large static list storage
What would be the best way to store a static list of integers in Mojo? I would just like to be able to initialise a large (tens of thousands) number of integers in a static list much like in python so that i can access values from other mojo programs.
5 Replies
Congrats @nickfury3398, you just advanced to level 1!
I tried initialising a List but its taking an extremely long time to compile into a package or import anywhere else
On first glance your options would be StaticInttuple, Pointer[Int] or DTypePointer[DType.int64]
if you know the values and have them in a manner where you can type or copy them all, i’d probably just use StaticIntTuple
in this case DTypePointer and Pointer are similar but if you want to use SIMD anytime i’d go with DTypePointer, but i’m assuming you know the size of the list at compile time
Thanks,, will try it. I sent you a message with a follow up if you dont mind
ofc