11 comments

[ 4.2 ms ] story [ 30.8 ms ] thread
It’s looking less and less like Python. At this point, might as well be writing Rust
Wow no kidding! I had Mojo remembered as a “Python 4.0”, but briefly looking over it it’s much more like Rust indeed. They even have ownership and moving? There’s no way your average data scientist or data engineer will touch this (I thought that would be the target audience).
The target audience right now seems to be language enthusiasts and people writing custom compute kernels for machine learning applications. I’m sure as they get closer to a 1.0 release the syntax will be made more ergonomic/pythonic. Also the low level features are pretty opt-in and I think in the future the language will encourage the practice of writing high level pythonic APIs over optimized low level routines
But again, why though? Why would someone writing custom compute kernels do it in some closed source language that just recently released instead of a language like Rust that has much more momentum behind it as well as similar safety guarantees? If Mojo was fully compatible with Python and simply sped up the code, then it's understandable why one would use it, as indeed that's what I thought they were doing (being akin to TypeScript, ie improving the base language in compatible ways that aren't so different as is the case here with borrow semantics), but it seems like they're pivoting out of data scientists.

And again, if in the future one can write higher level code (which is also possible in Rust via simply ignoring borrow semantics and cloning everywhere, where you still end up with a much faster program than in, say, TypeScript or Python simply due to the compiled and lack of GC nature of Rust), as well as higher level APIs on top of low level routines, how is that any different than Python which already has C++ implementations for popular libraries underneath their Python APIs?

It seems like Mojo doesn't really know what kind of language it wants to be and is throwing features at the wall.

I think the killer feature of Mojo is that it's basically syntax sugar for MLIR, which is a new "mid level IR" for the LLVM project, and many 'dialects' have been added that can target specialized transformations for machine learning workloads and data structures. It's the secret sauce that Rust doesn't have.

In their early roadmap they said they wanted to take ideas from swift and rust (and C++), and this is just one part of it. They'd been planning on adding Traits eventually, they're just getting there carefully.

Knowing Lattner's previous work, I'm confident Mojo will eventually be open source, they've just said they want to get it right first, which I can respect. But If you compare Mojo with other new 'systems-level' languages like Carbon and Hylo, the Mojo team is basically speed running language development, which is really impressive. I think a big part of what makes that possible is that they're building directly on top of MLIR.

I was going to write a similar comment. It doesn't look like python anymore
It’s a very low level language in the alpha stage and the dev team are explicitly not prioritizing syntax sugar or developer ergonomics. The syntax will definitely change substantially and become more ergonomic over time.
I agree, and at least Rust is open source and now has new upcoming AI and scientific computing libraries like burn and polars. Sure, it's not the level of Python, but at this point, why use Mojo instead?
So they have given up and are looking to get acquired now? All vision and taste have left the org.
One of the really neat things about mojo is, as a superset of python, things like static typing, and ownership/moving can be gradually adopted. It encourages value semantics, and is borrow-by-default. So you can literally just write pythonic looking `def` functions, but then gradually opt in to the more performant features, e.g. with `fn` functions.

In my mind this is kinda similar to what TypeScript does as a super-set of JavaScript- except that was not about performance, it was about purely about typing.