that's cool but mojo literally just came out
that's cool but mojo literally just came out
There are always tradeoffs, and it usually takes a few weeks for people to come to terms with why Julia is unique.
Definitely falls into the fun category. =)
https://fortran-lang.discourse.group/t/fortran-is-faster-tha...
gcc is notoriously:
1. inefficient compared to the Intel or LLVM compiler
2. nondeterministic with -O3, which is why most people use g++ to check the code... and even then all bets are off on some hardware.
3. thrashes ram layouts, and slowly chokes to death if used as intended.
It comes down to the use-case, but fortran has killed too many to trust anywhere. =)
In general though it's just a question of which hoops you have to jump through for which language comparing C/C++/Julia/Fortran when using LLVM
Only a few like Go ecosystem developers tended to take the time to refactor many useful core tools into clean parallelized versions in the native ecosystem, and to a lesser extent Julia devs seem to focus on similar goals due to the inherent ease of doing this correctly.
When one compares the complexity of a broadcast operator version of some function in Julia, and the amount of effort needed to achieve similar results in pure C/C++... the answer of where the efficiency gains arise should be self evident.
One could always embed a Julia programs inside a c wrapper if it makes you happier. =)
This might sound counterintuitive given that latency is a normal problem mentioned everywhere else about Julia. But, if you think about it, Julia compiled to native code a plot library from scratch in 15- seconds every time you imported it (before Julia 1.9 where native caching of code was introduced, and latency was cut down significantly).
This makes that problems where you would like to (for example) generate polynomials in runtime and evaluate then a billion times each, Julia can generate efficient code for ever polynomial, compile it and run it fast those billion times. C/C++/Fortran would have needed to write a (really fast) genetic function to evaluate polynomials, but this would have always (TM) been less efficient than code generated and optimised for them.
Edit: typos and added some remarks lacking originally
The reality is that the Julia optimization was just a rewrite to use the same algorithm as Mojo, and that the Mojo code was heavily optimized.