News for hackers. Stuff that matters.
Re:Mojo is a much better “Objective-C without the C” than Sw... by simias on Monday June 12, 2023 @07:22AM (#36291722)
I chuckled a bit when I saw that they market themselves as "faster than C". Is it 2005 again? Do modern developers even have any notion of how fast C runs to use as a baseline?

It's really minor thing but a pet peeve of mine, I remember how twenty years ago every new language claimed to be as fast or faster than C, and every time the benchmark was some ultra-optimized non-idiomatic program in that new language against a naive C implementation, and the C version was usually still 20% faster and use 10% as much RAM with the right compile flags.

Are there even Mojo benchmark in the wild? The FAQ entry[1] just finds excuses for situations where it does not perform well...

[1] https://docs.modular.com/mojo/faq.html#performance

Re:Mojo is a much better “Objective-C without the C” than Sw... by boxed on Monday June 12, 2023 @08:10AM (#36292183)
I mean.. it does depend on what you mean by "faster than C" of course. Writing the straight forward naive solution in Mojo for some problems can produce code that can run on both CPUs and GPUs and be super fast. Can you get the same performance from C? Probably.. with lots on intrinsics and one code base for GPUs and one for CPUs, where the GPU codebase might even be multiple code bases for different vendors.

I would say "faster than C if you want to keep your sanity and don't have infinite time". It doesn't roll off the tongue though :P

Re:Mojo is a much better “Objective-C without the C” than Sw... by miohtama on Monday June 12, 2023 @10:13AM (#36293748)
Three ways to beat the performance of C “easily”

- Run on GPU

- Automatic loop parallelisation

- Microbenchmarks where C is slow due to pointer aliasing (this is why Ocaml is faster than C)

Re:Mojo is a much better “Objective-C without the C” than Sw... by Certhas on Monday June 12, 2023 @08:17AM (#36292249)
The benchmarks they give here [1] show generic code on par with specialized libraries that are typically written in assembler. These are vastly faster than naive C implementations, so your pet peeve really does not apply here.

[1] https://www.modular.com/blog/the-worlds-fastest-unified-matr...

I kind of agree with the obnoxiousness of the marketing, but it pays to actually read a little of what they do before jumping to conclusions.

If only because its Chris Lattner behind it, obviously not someone who is your average "modern programmer".

Re:Mojo is a much better “Objective-C without the C” than Sw... by TheAlchemist on Monday June 12, 2023 @08:43AM (#36292517)
I know nothing about low-level optimizations, but I love playing with different methods and benchmarks. And did try Mojo through their playground. I found it a bit more complicated than anticipated (well, I did believe it's just like python but much faster...) but also very impressive speed.

It's impossible to say for sure, since you can't run the benchmark on your machine and god knows what's behind the playground. However, I compared my naive implementation to find min of a rolling mean using python with numba, pandas, polars, numpy and mojo version.

Mojo version was faster than polars and numpy, which in turn were faster than pandas and numba. That's my N=1 of course, and not a reliable benchmark. But still, I find it very impressive.

Re:Mojo is a much better “Objective-C without the C” than Sw... by spmurrayzzz on Monday June 12, 2023 @09:43AM (#36293296)
Lattner being behind Mojo always engendered some benefit of the doubt despite my initial gripes with the marketing claims, but his recent interview with Lex Fridman [1] further emboldened my stance that if Mojo can succeed, Lattner is one of the best-positioned engineers to see it through.

[1] https://www.youtube.com/watch?v=pdJQ8iVTwj8

Re:Mojo is a much better “Objective-C without the C” than Sw... by svantana on Monday June 12, 2023 @11:28AM (#36295182)
That article says nothing about how they achieved those numbers. Meanwhile, in the mojo docs, the matmul results are 20-50x slower for some reason:

https://docs.modular.com/mojo/notebooks/Matmul.html

Re:Mojo is a much better “Objective-C without the C” than Sw... by aaroninsf on Monday June 12, 2023 @01:25PM (#36297348)
It's worse than obnoxiousness; the posture they have taken engenders skepticism and distrust.

When making technical claims to a technical audience, and vs Lattner leveraging reputation,

the appropriate approach is clearly not this. It's to lead with conservatively stated claims, reproducible results, and all the rest of the apparatus that is collectively understood as how adults (from which I exclude bizdev) demonstrate a better mousetrap, into an environment within which the cost of switching mousetrap technology is very great indeed at every level.

Big asks deserve and require better.

Re:Mojo is a much better “Objective-C without the C” than Sw... by Certhas on Monday June 12, 2023 @02:24PM (#36298514)
Meh?

They are VC funded and this is the pitch to the VCs in order to get money.

Obviously this is not convincing on a technical level yet. But it's also really interesting as a design.

And while the code isn't open source, I for one find it pretty fascinating to see the language being iterated on in public like this.

Edit: E.g. https://github.com/modularml/mojo/blob/main/proposals/lifeti...

or

https://github.com/modularml/mojo/blob/main/proposals/value-...

Re:Mojo is a much better “Objective-C without the C” than Sw... by PartiallyTyped on Monday June 12, 2023 @04:53PM (#36300935)
For anyone interested on why a VC would fund a PL, modular attempts to build the new shovels for the AI revolution; meaning their own platform to develop models.
Re:Mojo is a much better “Objective-C without the C” than Sw... by qaq on Monday June 12, 2023 @08:26AM (#36292336)
I would imagine creator of Clang and LLVM has a bit of an idea of how fast C runs :)
Re:Mojo is a much better “Objective-C without the C” than Sw... by LeoNatan25 on Monday June 12, 2023 @10:05AM (#36293604)
Didn’t that team at Apple (with Lattner at the helm) also claim Swift was “faster than C”? I am yet to be convinced that in the general case, this is true, especially with the recent language bloat and lack of substantial compiler optimizations. But it wasn’t true back when Swift was released either.
Re:Mojo is a much better “Objective-C without the C” than Sw... by qaq on Monday June 12, 2023 @10:07AM (#36293655)
Could you provide a source for that?
Re:Mojo is a much better “Objective-C without the C” than Sw... by simias on Monday June 12, 2023 @11:27AM (#36295151)
Sure, I should have been clearer, what I had in mind was more "do potential users of Mojo even know or care about how fast C is?"

In my experience the new generation of devs haven't touched C and treat it like some kind of weird arcane language, a bit like what Fortran and COBOL were when I started coding around 2000.

Re:Mojo is a much better “Objective-C without the C” than Sw... by whimsicalism on Monday June 12, 2023 @11:45AM (#36295443)
New generation here, I don't see why I would ever code in actual C99 when (at worst) I could just code in C-style C++ but have some of the nice things.
Re:Mojo is a much better “Objective-C without the C” than Sw... by nradov on Monday June 12, 2023 @02:19PM (#36298401)
The only reason for coding directly in C without using any C++ features would be if you have to contribute to a code base that is restricted to C. The Linux kernel being the most prominent example, but also a lot of embedded devices.
Re:Mojo is a much better “Objective-C without the C” than Sw... by Tozen on Tuesday June 13, 2023 @06:45AM (#36308226)
> ..."do potential users of Mojo even know or care about how fast C is?"

I doubt their potential users would care so much, as long as it's significantly faster than Python and they don't need C or C++, except as an option and not as a necessity. That's been the point of various other alternative languages.

The claim to fame of various newer compiled languages, is not just being as fast as C, but that they are better alternatives to use, for their audiences. Being easier to use, read, or/and learn. This is where some of the drama comes from, because some will make it about speed, and ignore the other elements of what is "attractive".

Re:Mojo is a much better “Objective-C without the C” than Sw... by LeFantome on Monday June 12, 2023 @08:31PM (#36303437)
Faster than Java with 5% of the memory? Lots of devs should get that.
Re:Mojo is a much better “Objective-C without the C” than Sw... by fulafel on Monday June 12, 2023 @08:42AM (#36292500)
I know you didn't mean exactly 20 year old languages but felt the itch to look it up - 2003 was a year of JVM languages[1]. Groovy and Scala are dated 2003. (Clojure came a bit later, in 2007)

[1] https://en.wikipedia.org/wiki/History_of_programming_languag...

Re:Mojo is a much better “Objective-C without the C” than Sw... by classified on Monday June 12, 2023 @09:54AM (#36293453)
If it's "faster than C" you know the author never saw anything but JavaScript and maybe Python.
Re:Mojo is a much better “Objective-C without the C” than Sw... by celeritascelery on Monday June 12, 2023 @10:15AM (#36293785)
Chris Lattner (The creator of mojo) also made clang and LLVM, so he definitely understands what C can do.
Re:Mojo is a much better “Objective-C without the C” than Sw... by TheAlchemist on Monday June 12, 2023 @04:57PM (#36300993)
This must be the funniest comment in this thread. Did you see who the creator of Mojo is ?