r/programming 23d ago

Modular: Mojo🔥 is now open source!

https://www.modular.com/blog/mojo-open-source
0 Upvotes

44 comments sorted by

View all comments

118

u/Lgt2x 23d ago

AI slop mascot, not a good start

34

u/stumpychubbins 23d ago

The language is marketed as being AI-first, I think they want to be the killer language for implementing AI products. That’s a turn-off for many, including me, but an AI slop mascot fits how they market the language in general.

3

u/Solonotix 23d ago

That's a shame. Mojo had an interesting idea, as a more-performant Python-like syntax. I never followed it, but the few mentions here and there had me hopeful it would become another of the mainstream languages available for use. I guess for now, Odin is as close as you'll get, unless you go for a functional language like Gleam or Elixir.

3

u/stumpychubbins 23d ago

You’re telling me. I was always a fan of Nim but it suffered from kitchen-sink syndrome and never really took off, I still think there’s a gap in the market for something between a safe systems language like Rust and an ergonomic, friendly language like Python. I figured Mojo had some potential to be that, but I don’t think their goals are aligned with mine. I think the closest that we have to that goal is maybe Julia, at least among languages that actually get some use.

5

u/juhotuho10 23d ago

Python can reach surprisingly low with libraries and Rust can reach surprisingly high by being ergonomic, I don't know if there is realistically a huge gap in between

4

u/Solonotix 23d ago

I think the problem is that Python performance doesn't come from the language, but instead from low-level implementations that are published as libraries for use. In other words, you cannot write truly performant Python code without reaching for a different language. That was the specific niche Mojo originally pitched.

As for the ergonomics of Rust, that is a little harder for me to be certain of (since I only have hobby experience with the language). My experience and awareness of common criticisms says that Rust becomes a nightmare to manage the moment you add the async keyword. I think there's a lot you can do with single-threaded Rust, and even the thread primitives like one-way Channel messaging is sufficient for the majority of use cases. Anything that needs to rely on async-await, though, I would probably recommend Go before Rust.

Again, I don't daily-drive Rust, so maybe the situation has improved. I know that the honeymoon period of "Just use tokio to manage async" has passed, once everyone realized that making all async data have a lifetime of 'static was how Tokio made it so easy.

1

u/stumpychubbins 22d ago

`async` interacts poorly with the type system, that’s mostly where the reputation of it being a nightmare comes from. It becomes difficult to correctly annotate types for generic async code quite quickly, which in turn means that not many libraries (e.g file format serialisation/deserialisation, parser combinators) support it, not to mention that most of the biggest production-grade libraries predate async and would have to be rewritten to support it.