samufi
MModular
•Created by samufi on 9/21/2024 in #questions
How can I use a fixed-size integer type to index a list?
I was not sure if the
int
is a function call (introducing some overhead, maybe copying of values). If it is really equivalent to a "reinterpret cast" in C++, then this is awesome. I do not yet have a feel for what is going on under the hood in mojo.7 replies
MModular
•Created by samufi on 9/21/2024 in #questions
How can I use a fixed-size integer type to index a list?
Thanks. I noticed I need to use the lower case
int
function. I have tested different versions and was not able to measure a significant performance penalty.7 replies
MModular
•Created by samufi on 8/2/2024 in #questions
How can I write asynchronous code?
Thanks, this is very helpful!
11 replies
MModular
•Created by samufi on 8/2/2024 in #questions
How can I write asynchronous code?
Hmmm, it still looks not asynchroneous...
If we call
call_it
, we get
6916.1215625790001 6917.1220518390001So the functions are not executed in parallel. It seems as if it is waited until
await
is called. So what am I doing wrong? How could I achive asynchonity?11 replies
MModular
•Created by samufi on 8/2/2024 in #questions
How can I write asynchronous code?
I was pointed to the answer in a different channel. I need to "delete" the coroutine when waiting for it.
11 replies
MModular
•Created by samufi on 8/2/2024 in #questions
How can I write asynchronous code?
Or am I simply doing it wrong? (Anyone here who has used
async
in mojo??)11 replies
MModular
•Created by samufi on 8/2/2024 in #questions
How can I write asynchronous code?
Any updates on this yet @Ehsan M. Kermani ? The issue is still there in the current nightly.
11 replies
MModular
•Created by samufi on 8/5/2024 in #questions
Is there a (N-D) contiguous data structure for non-trivial structs?
Then the only remaining question would be which container provides inline-vector-like functionality but can hold tuples and implements
CollectionElement
6 replies
MModular
•Created by samufi on 8/5/2024 in #questions
Is there a (N-D) contiguous data structure for non-trivial structs?
Yes, I think in principle,
List
is not too bad for the "outer" array (except that I need to wrap it into a 2D structure around for simple access). I guess this is the easiest approach if no one else has done the work so far...6 replies
MModular
•Created by samufi on 8/5/2024 in #questions
Is there a (N-D) contiguous data structure for non-trivial structs?
Thanks! Hmm... I do not know the size of the outer array at compile time. Is there an alternative with dynamic memory?
6 replies