Hacker Newsnew | past | comments | ask | show | jobs | submit | totalperspectiv's commentslogin

Finally got me to unsubscribe. I'm surprised that the whole crew of them were cool with reposting the snippet of DHH calling linux maintainers "clowns and goblins" amongst other things.

https://x.com/thestanduppod/status/2091511392717213707?s=20


Yeah that video is disgusting. He’s completely unhinged


https://mojolang.org is the best spot for getting started generally. numojo is the closest thing to numpy right now. You can check out more packages here: https://github.com/modular/modular-community/tree/main/recip...


This is really exciting. I've been using Mojo off and on for side projects over the last two years.

(copying from some previous Mojo threads) It's got an ownership system adjacent to Rust, comptime similar to Zig, and a first class dependent type system. Even more exciting, is that uses LLVM (to the best of my understanding) in some novel ways and for more optimizations.


Hm, in docs they say that dependent type system is not first class seems.

Is it even dependent? More like refinement types, which seems will be in Rust too.Also HN recently mentioned Rust building similar llvm based integration with GPU.

But compared with Python, Julia, Matlab, R, Rust, C, C++ - Mojo feel relief for working with numerics.


I don't agree at all with your last paragraph. MATLAB and Julia are lovely for numerics, maths is terse and looks like maths! Mojo is hobbled by choosing Python style syntax, which does not lend itself well to maths.

WRT the type system, I agree MATLAB is a mess but Julia's multiple dispatch feels more like maths than any other language I've tried.


I coded Matlab in uni, never got it. And had to look Julia code. I have to learn it to read. I am more SEng rather then Sci or Quant. And on compile time types. So for me Julia is foreign and forces me to look both Python and Julia.


What problems do you run into for maths with Python? For linear algebra and ML with Jax/Numpy I find it quite readable.


I think problems is too strong a word, it's just how the syntax looks. And of course it's far better than say C++. But specifically, the lack of native vectors/matrices and very few infix operators (e.g dot product, and matrix multiplication with @ is clunky). Explicit but generic broadcasting using `.` also helps.

The way that types interact with methods _feels_ like maths. I.e. you have a method made up of mathematical operators, if you swap out an input, it typically does the natural and correct thing.


> But compared with Python, Julia, Matlab, R, Rust, C, C++ - Mojo feel relief for working with numerics.

Out of those, Julia is the only one that combines Multiple Dispatch and native code, both important for numerics.


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


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.


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?


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.


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.


The novelty is in parrelizing LLVM, which is traditionally a single-thread code generator.


So basically LLVM catching up with times.


Well, LLVM itself is still single-threaded; they just designed Mojo's compiler in such a way that the code generation part can be parallelised, which is something you can do if you understand LLVM from top to bottom. As far as I can see, no other production-grade LLVM consumer has been able to make it parallel; the single-threaded nature remains a major performance bottleneck.


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

> The novelty is in parrelizing LLVM, which is traditionally a single-thread code generator.

You said they parallelized LLVM with novel techniques, but then claimed the novelty is the very act of parallelizing it. That's circular, you still haven't explained what are the novel techniques?


Here is a presentation talking about the parallelization techniques, I skipped to the relevant part but the entire presentation is helpful in understanding how Mojo's compiler works: https://youtu.be/yuSBEXkjfEA?t=813&si=MlB7IsBDsj3o-PTX


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.


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


Carp has been slowly inching forward and ticking those boxes


Per modular Twitter, the plan is still to open source the mojo compiler this year: https://x.com/Modular/status/2069787078032834635


I thought he stopped working on LuaJIT? Is it back in active development?


Well, looking at the commits, he has been regularly contributing for the last ten years at least. I don't know if he had stopped for a while.


Me too! I've been using it for bioinformatics related work, and it is absolutely fantastic. I can't wait for it to hit fully open source status so it can be easily recommended.


Full open source Mojo 1.0 coming this fall!


I work in bioimaging. What kind of bioinformatics are you doing that requires mojo level power?


"requires" is a strong word, but I implemented an alignment kernel that can do alignments on the GPU.

Overall I think there is going to be a lot of "old" gpu compute hanging around, and now that writing kernels is a lot easier than it has been, we might as well try and see what algorithms we can get working there.

I originally picked up Mojo for the SIMD, not for the GPU kernels. The SIMD usability in Mojo is outstanding.

Paper on the tool I wrote: https://doi.org/10.1093/bioadv/vbaf292


Very cool!

I have been pretty hopeful about Mojo as I find many of the modern compiled languages these days requires an surprisingly excessive amount of ceremony just to open a file and read it line by line. At least this is the case with Go, as I've written about [1].

If Mojo is providing any kind of python like experience in this matter, I will be all into it again (it lacked these features when I last tried).

[1] https://livesys.se/posts/golang-for-bioinformatics/


I'm really quite divided about Rust vs Mojo for bioinformatics in the future.

The syntax i Mojo really seems to shine a lot ... though I still wonder if the train has already left now that so much bioinfo work is already done in Rust.


I might have to look into mojo.

What's "alignment" in your context. In bioimaging it usually refers to aligning something to a reference atlas (like the Allen Reference Mouse Brain Atlas) or aligning two microscope channels (like the red channel and green channel)


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 that is more powerful than 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.


> ..., comptime that is more powerful than Zig

It would be great if you can elaborate more here. I can't make the conclusion from Mojo's docs now.


Not OP, but see the entire section on metaprogramming: https://mojolang.org/nightly/docs/manual/metaprogramming/. Mojo's compile-time programming is influenced by Zig, but has features that are not in Zig e.g traits, generics (real generics), and constraints, that work together.


It might be feature richer, but it is hard to say it is more powerful. Sometimes, features (especially constraints) will reduce powerlessness.


That's fair, I think I should have just said "comparable to Zig". The type'd ness is what I was thinking of, but having actually written some zig in the last few days to play with their Io model / see what passing around an allocator is like, Zig is pretty fantastic.

I still prefer the structure in Mojo, but boy do I miss if/switch as expressions.


Well, it certainly allows you to encode invariants in a more precise manner.


The author works for Modular. He shared the write up on the Mojo Discord. I think Mojo users were the intended audience.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: