6 ms·
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 us
by simias 3y ago
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 https://docs.modular.com/mojo/faq.html#performance
- boxed 3y agoI 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
- miohtama 3y agoThree 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)
- Certhas 3y agoThe 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-matrix-multiplication 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".
- TheAlchemist 3y agoI 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.
- spmurrayzzz 3y agoLattner 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 https://www.youtube.com/watch?v=pdJQ8iVTwj8
- svantana 3y agoThat 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 https://docs.modular.com/mojo/notebooks/Matmul.html
- aaroninsf 3y agoIt'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.
- qaq 3y agoI would imagine creator of Clang and LLVM has a bit of an idea of how fast C runs :)
- LeoNatan25 3y agoDidn’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.
- qaq 3y agoCould you provide a source for that?
- simias 3y agoSure, 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.
- whimsicalism 3y agoNew 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.
- nradov 3y agoThe 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.
- Tozen 3y ago> ..."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".
- fulafel 3y agoI 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_languages https://en.wikipedia.org/wiki/History_of_programming_languag...
- classified 3y agoIf it's "faster than C" you know the author never saw anything but JavaScript and maybe Python.
- celeritascelery 3y agoChris Lattner (The creator of mojo) also made clang and LLVM, so he definitely understands what C can do.
- TheAlchemist 3y agoThis must be the funniest comment in this thread. Did you see who the creator of Mojo is ?