Hacker News new | past | comments | ask | show | jobs | submit
Having written a lot of Mojo over the last two year, just for fun, it's a really cool language. Ownership model adjacent to Rust, comptime in the realm of Zig, rich type system, first class SIMD support, etc. Performance wise it's the first language in long time that isn't just an LLVM wrapper. LLVM is still involved, but they are using it differently than say, Rust or Zig.

Very excited for Mojo once it's open sourced later this year.

> LLVM is still involved, but they are using it differently than say, Rust or Zig.

Chris Lattner said in a Developer Voices podcast interview:

"Swift in a way was syntactic sugar for LLVM, at the very bottom of the stack it could talk directly to LLVM primitives. Mojo does basically that same trick, but it supercharges it by moving to this MLIR world."

> Performance wise it's the first language in long time that isn't just an LLVM wrapper

Why? Because it uses MLIR? Rust has its own MIR, it's even more not-LLVM-wrapper.

Probably because the creator created both LLVM and MLIR.
I'd assume Mojo does more complex transformations at the MLIR level than Rust does at its MIR level.
First, I'm not sure. Rust has MIR optimizations and also other transformations.

But even if yes, MLIR is part of the LLVM project, so it's technically still "just an LLVM wrapper".

loading story #49266359
How are compile times compared to Rust? Zig? Go?
Mojo is much faster than Rust, but slower than Go. I don't have much experience with Zig.

Mojo is designed to be very fast to compile, so many decisions were made to keep the core language simple, one example is in `where` clause, the checking there happens entirely in the parser. It can be stupid in situations where other languages are smart, and make you explicitly do checks that could be inferred in other languages. But on the other hand, it can be very fast since it doesn't have to do all the complicated resolving.

Another reason is how LLVM is used, Modular found ways to parralize LLVM code generation by introducing novel techniques that'll likely become a lot more popular with other languages.

> Modular found ways to parralize LLVM code generation by introducing novel techniques

What techniques?

loading story #49269144
From experience, Zig compile times are at least as fast as Go for debug builds that don't need to do linking with C libraries, etc. It does have to use LLVM for release builds however which is a lot slower.
loading story #49266628