by chrislattner · 3y ago · 0 comments
That said, Mojo is a completely different thing. It is aligned with the Python community to solve specific problems outlined here: https://docs.modular.com/mojo/why-mojo.html
Mojo also has a bunch of technical advancements compared to Julia by virtue of it being a much newer development and being able to learn from it (and Swift and Rust, and C++ and many many other languages). Including things like ownership and no GC. We also think there is room for a new language that is easier to deploy, scales down to small envelopes, works directly with the full Python ecosystem, is designed for ML and for MLIR from first principles, etc.
Julia is far more mature and advanced in many ways. Many folks have and will continue to push Julia forward and we wish them the best, it is a lovely ecosystem and language. There is room for more than one thing! :)
EDIT: Just in case there is any confusion, I work for Modular, built LLVM, Swift, Clang, MLIR and a variety of other things. I wasn't trying to misrepresent as being unaffiliated.
In general this tends to be true. However, in this case I'm not so sure. Modular seems to have garnered a lot of investment - probably orders of magnitude more than the Julia community has been able to get. There are a lot of nagging problems in Julia (startup times - though that's gotten better recently, ML kernel performance, and executables come to mind) that could have been easily fixed if they had the money to throw at them. Since they haven't had that kind of investment people who kick Julia's tires tend to see these things as built-in limitations and move on.
One of Julia's often complained about issues is that it could use way more developers than it has now. No amount of romanticizing a small community or "independent culture"(which I just can't see going away due to where a lot of people that come to Julia are coming from in the first place) is going to fix that, just more people coming aboard the ship.
So its not so obvious that a larger investment would scale so we'll immediately. (But it might force Julia to get better with these things...)
You needed much less stuff supported out of the box when Python first came on the scene. Today expectations have gotten much bigger. A minimal viable language has far more requirements.
For Mojo, I'm interested in seeing how the language can be used as a path forward for the Cython community. This could be a stepping-stone towards reimplementation of Python in Mojo. For the past 3 year, I have been talking about the need for a Python-Steering-Council-recommended extension language for Python. This will be particularly important as WebAssembly keeps progressing and potentially redefining what we mean by virtualization and containers.
We have already been using LLVM extensively in Numba and there have been several explorations around MLIR and related technologies. There are several potential paths forward and I'm looking forward to finding ways to cooperate.
Understanding what will be open-source is of course, critical for that.
But the cost has already been paid. We have NumPy, we have PyTorch and TensorFlow. So I don't see the value-add here. Maybe there's something I'm missing.
They are just not accustomed to seeing libraries being that small. That is possible in Julia because it is all native Julia code which means interfacing with other Julia code works seamless and allows you to mix and match many small libraries very easily. You can reuse much more functionality which means individual libraries can be kept very small.
For PyTorch and TensorFlow e.g. activation functions have to be coded specifically into each library. In Julia these can just be reused for any library. Each ML library doesn't need to reimplement activation functions.
That is why you get these bloated monoliths. They have to reinvent the wheel over and over again. So yeah there is a cost which is constantly paid.
Every time you need to extend these libraries with some functionality you are paying a much higher price than when you do the same with Julia.
Taichi already allows for amazing speedups and supports all the backends (including Metal) https://www.taichi-lang.org/ the fact that they didn't mention Taichi is a glaring omission.
JAX is that next version of TensorFlow, https://jax.readthedocs.io/en/latest/notebooks/quickstart.ht...
This looks like a reboot of Numba with more resources devoted to it. Or a juiced up Shedskin. https://shedskin.github.io/
I think Mojo is a minor mistake, I would caution adoption, it is a superset fork of Python instead of a being a performance subset. Subsets always decay back to the host language. Supersets fork the base language. I would rather see Mojo integrated into Python rather than adopting the language and extending.
I have a theory why Mojo exists. The team was reading a lot of PyTorch and Tensorflow, getting frustrated with what a PIA working with C++ and MLIR is for their model-backend retargeting codegen, so they created their perfect C++/Python mashup rather than use TVM. They nerd sniped themselves and rather than just use Python3.12+mypy, they made a whole new language based off of Python.
As a comparison, auto industry is moving toward fully automatic transmission especially for the EV but software industry is still undicided and seems cannot even come up with a robust GC mechanism that is on par with no GC in term of performance.
With no GC, interpreted programming language e.g. Python will most probably being used well into the future alongside Mojo/C++/Rust because majority of AI/data science/machine learning programmers cannot even bother to touch the underlying codes for the fear of programming complexity of these no GC languages.
I vehemently disagree. D's GC is the #1 reason for its fade into obscurity, instead of becoming a viable C++ competitor. Now it's completely overshadowed by Rust's success.
Regarding Rust vs D popularity, time will tell. When at the same age of D now, circa 2000s Perl was notably more popular than Python but then Perl lose its steam and fade into obscurity.
Regarding the sibling's comment on borrow checker, D now can support borrow checker and it's just a feature like its many capable features and Rust actually took it from Cyclone [3].
[1]TIOBE Index for April 2023:
https://www.tiobe.com/tiobe-index/
[2]Ownership and Borrowing in D:
https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in...
[3]Cyclone (programming language):
https://en.wikipedia.org/wiki/Cyclone_(programming_language)
It's because, first, there was manual memory management, which was error-prone.
Then came garbage collection, which was safe but slow.
Most recently came borrowing and move semantics, which offers the best of both worlds -- safety and speed -- at the cost of some (arguably justified) cognitive overhead and code flexibility.
So I absolutely don’t think of the borrow checker as superior to a GC, it’s a different tool with different tradeoffs. It was a good choice for a low-level language like Rust, but not necessarily for a high level language.
That, and optimized static binaries, would make Julia truly general purpose.
I don't mind Python syntax, I hope Mojo lives up to all these claims...it could easily (and finally!) hit the sweet spot of C performance, elegance, and expressiveness!
Also on a related topic, the PR for parallel GC in Julia just merged 4 days ago (https://github.com/JuliaLang/julia/pull/48600), so GC is in the process of getting a bunch faster.
What matters is how it is implemented, naturally a general purpose one won't do it.
This isn't true in most cases. If every subtree is only referenced by its (unique) parent, then you can use a standard Rust "Box", which means that during compilation, the compiler inserts calls to malloc() (when the Box is created) and free() (when the Box goes out of scope). There will be no reference counting — or any other overhead — at runtime.
Edit: seems some current hints are under the roadmap "Ownership and Lifetimes" heading but Python compatibility is not described yet.
This "detail" shouldn't be hidden away, it means a lot.
Modular can do exactly the same with existing Python packages, and lift them into Mojo that way.
Reference: https://numba.discourse.group/t/proposal-development-focus-f...
Edit: I see you're going to have protocols/ traits. Can those be specializes/monomoprhized at function call time like Julia abstract types?
And how about function specialization? Will functions be attached to structs in a single dispatch fashion or free floating multimethods?
Looking forward to see where this new adventure will lead, and congratulations !