upvote
> 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."

reply
> 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.

reply
Probably because the creator created both LLVM and MLIR.
reply
I'd assume Mojo does more complex transformations at the MLIR level than Rust does at its MIR level.
reply
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".

reply
MLIR is more a library for building a compiler than a compiler itself IIUC. LLVM can be thought of similarly, but IMO, it's more self contained.
reply
How are compile times compared to Rust? Zig? Go?
reply
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.

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

What techniques?

reply
I think they had a good dive here https://www.youtube.com/watch?v=SEwTjZvy8vw The gist is that MLIR (unlike LLVM) was designed to be multithreaded so the whole stack above LLVM IR is parallel, and then LLVM is used as a per-function codegen tool in parallel, so although LLVM itself is single threaded there are multiple seperate contexts of it. also I think they wrote their own linker.
reply
That is hardly novel, here is the thesis for the Oberon multithreaded compiler from 2003.

https://www.research-collection.ethz.ch/entities/publication...

C# compiler is also fully multithreaded since the Roslyn rewrite in 2016.

reply
The novelty is in parrelizing LLVM, which is traditionally a single-thread code generator.
reply
So basically LLVM catching up with times.
reply
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.
reply
Mojo compiles with O2 by default, it is similar to Go here. Release build is the default, debug is something you opt into. It is still very fast nonetheless
reply