Mohamed Mabrouk
MModular
•Created by jmky on 10/7/2024 in #questions
Is there a disdain for Rust from the Mojo team?
Early on, Mojo adapted the
&
convention for immutable references which was later renamed to borrowed
. I think the main idea in Mojo syntax is ensuring clarity of syntax on the expanse of line space. so &
and other signs does not really fit in the current Mojo syntax. Conceptually, Mojo explicitly follows Rust's lead in exclusivity checking and lifetime tracking.23 replies
MModular
•Created by cirqol on 9/8/2024 in #questions
Just learn Mojo?
It will be depending on the level that you are writing your package, for low-level mojo which involves memory management and playing around with pointers, python is not really useful here and emulating Rust or C code is more useful here, porting them to Mojo is in many cases easier to porting python.
If you want to port python code to mojo, then it is helpful to know python, but then only a small subset of python code that can be ported right now.
4 replies
MModular
•Created by Ethan on 7/25/2024 in #community-showcase
Matmul.mojo
Amazing effort .... it would be really interesting to further benchmark this implantation in other scenarios: single-core performance, scaling with the number of cores, comparison against Intel MKL, on a bunch of architectures... etc
29 replies
MModular
•Created by Frank Saez on 6/12/2024 in #questions
FFI
UInt was only recently introduced, so maybe it's not as complete as Int.
16 replies
MModular
•Created by Frank Saez on 6/12/2024 in #questions
FFI
I think size_t equivalent is Int (or maybe UInt?) which is the size of the pointer in your machine.
16 replies
MModular
•Created by Martin Dudek on 5/26/2024 in #questions
Why are you using Mojo?
I always wanted a language where I don't break my mental model when working with low-level ops and high-level data-sciency pipelines. I find it nice in Mojo to implement things like performant IO and parsing, statistics, and interactive visualization (currently, using Python interop) all in one language, same set of tooling .. etc.
23 replies
MModular
•Created by Mohamed Mabrouk on 5/19/2024 in #community-showcase
Blazeseq: Toolkit for FASTQ parsing
Update: BlazeSeq is starting going places .
I implemented a collection of quality aggregators in the
stats
module.
The current QC industry standard is written in Java, and although my implementation is yet to be finalized but I can already see at least 2x performance gain.
With time BlazeSeq should be exposed back to python one day as high-performance pythonic tool to build nice pipelines which you read and understand and still finishes in time.2 replies
MModular
•Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
Mojo's LSP?
24 replies
MModular
•Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
and It is pretty annoying in Java that you have to annotate evvverything
24 replies
MModular
•Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
I think the rust's approach fits quite well to mojo. It is not mandatory to annotate if the type can be inferred, you see your types while you are writing code, and you can intervene at any points. Instead of having to check the types once you inadvertly shoot yourself in the foot if the compiler inferred another type that you didn't want.
24 replies
MModular
•Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
One of the nicest approaches is by Rust's rust-analyzer where the inferred types is explicitly shown and you can either confirm, override or just leave as type hints.
If the same behaviour can replicated by mojo LSP, that would great
24 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
mojo-sort
Here is the results.
I ran the benchmark using
The server that I ran it on has dual AMD EPYC 7401 24 cores, 2 threads/core.
All the cores were working by they didn't reach 100%
47 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
mojo-sort
Should I run it on Mojo nightly or the main branch?
47 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
mojo-sort
No worries, just ping me when ever you are happy with the script.
47 replies
MModular
•Created by Jack Clayton on 5/11/2024 in #community-showcase
mojo-sort
If it can be useful and there is a benchmark script. I can run it on one of our quiet servers (96 cores Threadripper - Ubuntu server 22.04)
47 replies
MModular
•Created by Arvin_David on 3/28/2024 in #questions
How to Create a Multi-Type List in Mojo?
I wonder if something like
List[Object](1, 1.1, "string")
Would work? It is the most similar to Python way25 replies
MModular
•Created by Mohamed Mabrouk on 3/6/2024 in #questions
In-place replacement of struct fields
It works now, I think I had another bug in the code, Thnx
4 replies
MModular
•Created by Mohamed Mabrouk on 3/6/2024 in #questions
In-place replacement of struct fields
In my case it runs without error in debug mode (using run), it failes if you tried to build a binary first and ran it, I will edit the post
4 replies
MModular
•Created by Orwink on 2/16/2024 in #questions
If we talk about performance code, why is MLIR better than LLVM?
As I understand, MLIR should be similar to LLVM in normal use cases. However, MLIR allows for optimization for certain classes of problems which can't be done using LLVM, think AI compute graphs. Previously people would write custom Compilers for those kinds of problems (ex: XLA). MLIR allows those Compiler techniques to be incorporated in an interoperable Compiler framework so any language can make use of those out of the box without the need for DSLs and binding inside the language. Coupled with the ability to efficiently generate code for both CPU and GPU makes certain classes of problems which either depend on high level abstractions or use heterogeneous execution much faster while maintaining the performance of LLVM otherwise.
15 replies
MModular
•Created by clarkezone on 12/15/2023 in #questions
Difference between Float32 and DType.float32
Thnx
7 replies