Deep Dive into Ownership in Mojo
modular.com
modular.com
But then, at the end of the video, Chris says that Mojo has lifetimes! …But leaves an explanation for a future video.
So I'm looking forward to that.
I personally found the writing style of the proposal to be clearer than the tutorial-flavor of the original blog post (I haven't watched the video). But that's probably because I have a programming language background and am intimately familiar with Rust.
[1]: https://github.com/modularml/mojo/blob/main/proposals/lifeti...
I think the main advantage of Mojo would be its tight integration with the Python ecosystem (can conveniently call Python from Mojo)... Given the atrocities with existing C/C++ build systems, guess this could be a much lower barrier for deep learning people to delve into HPC stuff?
My understanding is that Mojo's portable SIMD builds on top of LLVM vector MLIR dialect, which is good. If this is indeed true, it would make it competitive with C# cross-platform SIMD which usually means just creating variables typed as Vector128/256/512<T> and using either the regular arithmetic operators on them or VectorXXX.Shuffle/PairwiseSomething/etc. for SIMD-specific operations without ever touching mnemonics (those can be intermixed behind branches of if (Arm64?) if an ISA of your interest has a more specific instruction, and these still consume the same vector types). Example: https://github.com/dotnet/runtime/blob/7ffb9a44ab32cd96d5684...
Even higher level abstraction can be built on top of that, e.g. Triton or ISPC style (just no one has done that yet, it's a relatively new addition to the language, the closest one is System.Numerics.Tensors which is C#'s own baby BLAS).
I'm very interested in Mojo as it seems like one of the few options where moving away from C# wouldn't be a huge downgrade, giving all the performance bits while being built on top of LLVM, for now waiting until it is fully open-sourced and becomes a public project.
Where Rust's default way of doing things gives you the most optimal performance (i.e no copy), you pay for that with code complexity and symbol soup syntax. If you want to move fast, you copy things, which is both ugly and wasteful.
Mojo on the other hand, based on the ownership presentation, by default makes some assumptions on your behalf for most common situations that you can then override if you need every ounce of performance out of the program.
I appreciate this approach more because I can hit the ground running and build something with great performance and then optimize it later when needed.
I'm looking forward to building something with it once they finish their work on the networking and asynchronous libraries.
MLIR was spearheaded by the same person who created LLVM, to add additional features that Google needed to build compilers for its in-house hardware AI accelerators.
Mojo is a new language that takes advantage of the new features enabled by MLIR, in the same way that Swift took advantage of the features previously enabled by LLVM.
Here's an interview with Chris Lattner discussing Mojo in much more generalized terms: