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
ModularBot
ModularBot8mo ago
Congrats @nickfury3398, you just advanced to level 1!
nickfury3398
nickfury33988mo ago
I tried initialising a List but its taking an extremely long time to compile into a package or import anywhere else
benny
benny8mo ago
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
nickfury3398
nickfury33988mo ago
Thanks,, will try it. I sent you a message with a follow up if you dont mind
benny
benny8mo ago
ofc
Want results from more Discord servers?
Add your server