Aamir
MModular
•Created by Aamir on 3/7/2024 in #questions
Need Opinion! Best Practices for Directory Structure and Unit Testing in Mojo Library?
👍🏼
4 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Just finalized the string builder library! Let me know if anyone of you see any improvement areas!
https://github.com/maniartech/mojo-stringbuilder
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Nope, I didn't do that!
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Great, good to hear that!
36 replies
MModular
•Created by Aamir on 2/28/2024 in #questions
Mojo Source Code Repository
Just wondering about the priorities related to Unicode support in Mojo? If possible can you share any update on that?
10 replies
MModular
•Created by Aamir on 2/28/2024 in #questions
Mojo Source Code Repository
I see. I am developing strings library. And wanted to see the best practices by looking into Strings code! Is there any way I can get access to that part?
10 replies
MModular
•Created by wooxus on 2/24/2024 in #questions
Anyone tried Zed with Mojo yet?
@wooxus Zed isn't available on windows which is my preferred OS for software development!
3 replies
MModular
•Created by sora on 2/24/2024 in #questions
How to disambiguates the call to `f`?
Something like
f[A](s)
would be good!2 replies
MModular
•Created by benny on 2/24/2024 in #questions
Traits from structs
Traits are just definitions, not implementations. Abstract class (or types) provides mix of implementation as well as definitions!
16 replies
MModular
•Created by benny on 2/24/2024 in #questions
Traits from structs
Is this something related to Abstruct Types found in object object programming languages?
https://en.wikipedia.org/wiki/Abstract_type
16 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
I updated the code and benchmarks! It now shows that the
StringBuilder
is around 10x faster than + concatenation!
Code
https://github.com/maniartech/mojo-strings/blob/master/strings/builder.mojo
Benchmark
Benchmark Result
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
What do you mean by "specializing by conformance", can you elaborate? I am not getting the context!
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
That means, calling through
__str__
poses significant overhead36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
When I moved to benchmark code into the
StringBuilder.__str__
function. I got this result!
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Also, when I benchmarked this code against concatenation using + operator. It failed significantly!
Benchmark Code
Result
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Still there are some questions to be answered to craft the perfect solution. Here are some of the points that I am considering!
* How does
DynamicVector
work? One of the area I am concerned about memory resize when new strings are pushed to the StringBuilder
. If DynamicVector
is not right data structure for this purpose, we can alternatively utilize resizable Buffer
. That will give good control over the strategy we employ for memory resizing!
* My second concern is how to handle various String types. StringLiteral
, String
, StringRef
etc... What about Stringable
?36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
Wow! It works!
36 replies
MModular
•Created by Aamir on 2/23/2024 in #questions
Fastest way to build string from dynamic values!
I don't think that's the case! Here is whole program derived from your
contact_str
function. Or maybe I am not able to see it!
36 replies