roboquant
roboquant
MModular
Created by roboquant on 6/29/2024 in #questions
Iterating over unknown sizes
Mojo iterators use the size and not an exception to indicate the end of an iterator. Is it still somehow possible to iterate over collections that don't have an upfront known size (like streams of data) ?
3 replies
MModular
Created by roboquant on 10/25/2023 in #questions
Iterables
Have trying out iterables (iter(self)) and for most part they already work. The only thing is that they are supposed to throw a "StopIteration" exception when done. Seems that exception is not yet exposed in the Mojo SDK. Also when raising an exception, Mojo forces you to catch them at the caller side, which is not what you want when iterating. I guess just have to be patient until it is fully supported. But would love to be proven wrong if someone knows a hack?
3 replies
MModular
Created by roboquant on 10/23/2023 in #questions
cannot bind generic !mlirtype to memory-only type
Have been playing with Mojo a bit and like it a lot so far. But one area I feel I'm missing out on something is Arrays. I implemented a simple Array struct using Pointer. Simple and straightforward to implement and fast. However Pointer only works with mlirtype, not my own structs. One solution is to decorate my struct with @register_passable("trivial"), but I feel there might be a more elegant solution. Any tips?
6 replies