There are a bunch of questions about Julia, so I'll do my best to give a short answer to a very long and complicated topic. Up front, Julia is a wonderful language and a wonderful community, I am a super fan.
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.
Congratulations on the launch! I think it's always a great thing to have people who know what they're doing put a new design out there. Raises the bar for everyone. For example, I think the Rust folks' work on error messages has really raised the bar on what is expected of systems is that regard. Sometimes people working on older systems feel a bit uncomfortable they see the bar being raised on them (it's weird to me to think of Julia as on "older" system, but I guess being around for more than a decade counts), but I actually prefer to think about it in the opposite way. There are lots of forces in systems design that push production systems towards conservatism. "We now have a million users, is it really worth spending the time/effort/risk on this new experimental parser/optimizer/feature, etc?", but if the rest of the world raises the bar, it's a great incentive to keep up and make all our systems better. So I very sincerely wish you the best of luck here and that in the areas where there might end up being overlap between Julia and Mojo people will start complaining to us that we need to be better, because we might just take them up on it ;).
> 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! :)
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.
This is too real and any of the great investment of manpower (e.g. Tensorflow for Swift) if happened to Julia would probably be 10x or 100x in terms of ROI -- just look at how few devs and line of code Julia's alternative to pandas/numpy/ML/autodidf/plotting has. If Julia ecosystem can be somewhat competitive while only having part time and researchers' side project contributors, it WILL thrive if properly invested.
Just a thought, but perhaps it's the small community and independent culture of Julia that has led to the high quality of its software. Small groups of highly passionate people can accomplish a lot! If I recall the history correctly, scientific Python (numpy, scipy, etc) developed similarly at first and has mostly supplanted Matlab, Fortran, and other tools. There was a point in time when Python was considered niche and not for "serious" work :).
Hard disagree. I think some people (not necessarily you, but way too many people) weirdly envy too much that "lone/few geniuses" image, and when they see bigger communities and their problem, they fallaciously/unfairly assume it's because of the size of the community (and not say, unnecessary bureaucracy that a small part of that community decided to have/had early on long before they got big).
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.
Julia (maybe by virtue of being a Lisp?) is tuned for the "lone genius developer" use case. Its feature set for enabling working in teams, where you'd want more well defined interfaces, explicit structure, control, checks, enforcement mechanisms for conventions, etc... seems weak by comparison with most other modern languages.
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...)
Julia 1.0 was released in 2018. That is just 5 years ago. I would say that is very young. Especially since a language today needs more than in the past. Julia has package manager, virtual environments, version management. Stuff that tends to be bolted on much later.
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.
people used to talk about R vs Python for data science many years ago, for instance, and we all know how that ended. imo if Mojo lives up to these claims, the pitch of Python compatibility is almost certainly too compelling to ignore. not to say Julia will die; R still has its uses and dominates some niche areas
R as a language was nothing to write home about. All it had going for it was its libraries. I never rooted for R, and I don't care for python anymore either. Python was general purpose, had enough libraries, and a bigger community. Its victory was predictable.
Congratulations on the launch and work so far! This is indeed very interesting. I believe a language like this is necessary for future progress. I have also been impressed with Julia and its progress. I would have liked to see more progress on Ahead of Time compilation and using it to write Python extension modules.
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.
>Python has amazing strengths as a glue layer, and low-level bindings to C and C++ allow building libraries in C, C++ and many other languages with better performance characteristics. This is what has enabled things like numpy, TensorFlow and PyTorch and a vast number of other libraries in the ecosystem. Unfortunately, while this approach is an effective way to building high performance Python libraries, its approach comes with a cost: building these hybrid libraries is very complicated, requiring low-level understanding of the internals of cpython, requires knowledge of C/C++/… programming...
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.
A clear complexity cost difficulty in extending these libraries. This separation force libraries to become huge complex monoliths. In Julia the equivalent is done with absolutely hilariously tiny libraries. In fact they are so small that many Python guys exploring Julia decide to not explore further thinking most of the Julia ML libraries aren't done or have barely started.
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.
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.
Very strange to have no GC as a innovative feature for a modern programming language. Personally I think Dlang get it right by making GC as a default and provide no GC as an optional feature.
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.
> Personally I think Dlang get it right by making GC as a default and provide no GC as an optional feature.
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.
The truth is we can only speculate whether the main reason D is less popular now due to its GC or D can be more popular now if it never had GC. Most of the D standard libraries are written in no GC thus performance is not an issue there and D with GC is not a sloth either. Based on programming language (PL) popularity evidence, generally for the similar age language for example Python (1991) vs C++ (1985), and Go (2009) vs Rust (2015), the PL with GC are way more popular than those without GC [1].
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].
Traditional GC isn’t less complex to program then automatic reference counting. Traditional GC has its place in short running extension languages, but in longer running programs you run the same risk of memory leaks as automatic reference counting since you can still over-retain from a poor ownership model. What goes wrong is slightly different, but with automatic reference counting it is easier for the compiler to find and report these issues. I feel you are conflating this with no automatic memory management which would be a higher barrier. Automatic reference counting greatly simplifies inter-op with low-level code and running on specialized hardware vs Python with interop.
RC is GC, but without cleaning up cyclic references. In general, leaking memory is not a security problem (and with a good debugger it is trivial to fix), so I don’t think it is too important a property. Leaking every cyclic reference is a bit more of a problem, but it has solutions like the occasional tracing phase like with a “traditional”, mark’n’sweep GC, but at that point why not just go with them as they are much more performant?
> Very strange to have no GC as a innovative feature for a modern 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.
GC is first and foremost a code design tool. Not having a GC causes less flexible code, every refactor will likely has to reimagine the memory ownership model at every relevant area.
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.
They claim they are writing the actual kernel code (as in the implementation of a matmul) with it, and it was presented as a "system programming language": this goes far beyond "high-level tasks" it seems.
I have wanted deterministic timing in Julia for years. It's come up periodically in the forums.
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!
Yes. There are already efforts in that direction, such as Julia Robotics (juliarobotics.org).
With Julia, there is work to be done to get to small, optimized, static binaries - which it sounds like Mojo will provide out of the box, given it’s targeting resource-constrained (and novel) hardware.
The Rust-inspired features are also VERY interesting!
This is not true at all! Julia usually being JIT-compiled makes it very unsuitable for real time applications (and there's no reason why it should be great for it). GC is the least issue here, and I say that as a fan and daily user of Julia.
Julia is already being used in a number of systems with varying levels of real-time-ness. It's early days for sure, but there's a bunch of progress. It turns out lots of "real time" applications actually just need fast code. JIT compile also can be overcome since in real time systems, you generally know all the code you are going to call so you can just make a .so with all of those bits compiled and know that nothing will need to be compiled at runtime.
The coolest I know of is ASML putting Julia on their giant chip making machines https://www.youtube.com/watch?v=EafTuyy7apY. I think there's also work on putting Julia on satellites, but I don't have the details.
Note that in Julia 1.9 (rc3 currently) and thanks to `PrecompileTools.jl` being adopted by the vast majority of the packages, the compilation latency is a dead issue... (ok, it is moved to the package installation time...)
PrecompileTools.jl has definitely not been adopted by the "vast majority of packages" and compilation latency is not a dead issue. There's been huge progress, and the rate of progress on this is much higher than before, but let's not get ahead of ourselves.
That is not really true. People think that because they have spent time with Java which is excessively GC dependent. More modern GC languages such as Go and Julia have opted to use GCs in a far more conservative manner. They don't produce the exorbitant amount of garbage that Java produces. I've talked to NASA guys using Go for real time systems. They say it works great. GC doesn't need to be a problem if you do it right.
Yes, I'm not saying it's not possible, but real time abilities were likely one of the least important aspects of Julia's design... So why shoehorn it into something it's not been designed for
After the 1st JIT-compilation (which here we treat as C++ static compilation), there is no compilation cost. As long as you avoid doing dynamic things (e.g. GC), there's a great case to be made for real time Julia.
Of course, but other than in C++ you need to use ways and means to achieve this - never hitting u compiled code - that are not very natural to Julia. Yes it may be possible to compile Julia code to binaries, but it obviously is neither straightforward nor widely used.
You could do a lot worse than modern GC. For instance, in Rust, lack of GC may cause you to reallocate memory or use reference counting, both of which are likely slower than GC. For instance, building a tree in Rust will do a lot of reference counting, which is a lot of heap accesses.
> building a tree in Rust will do a lot of reference counting
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.
Are there any plans on making linear algebra, numeric operations and so on first class citizens, the same way Julia does it? I believe that also a very compelling characteristic from Julia, for people working in Physics, Mathematics, Artificial Intelligence and Machine Learning is all the "sugar syntax" Julia gives you, is not the same translating a formula from a paper to numpy than translating it to Julia, in Julia writing the expression from a paper is almost a one-to-one mapping. I believe it will be a huge point in favor to Mojo, since UX when writing mathematical code in Julia is a huge advantage to it, the same way Python gained popularity as a General Purpose language because it is almost like writing plain English
As a former apple eng I guess I forgot that some people don’t know who Chris Lattner is haha. There isn’t anything unscrupulous going on here he probably just thought posting under his username was enough of disclaimer.
Congrats on the launch! In addition to the dramatic possibilities for ML, I hope mojo will have an impact in other scientific software through the ease of specialization to hardware capabilities. The current common subset of Python and “pure” mojo (ie not using CPython) is small, but will expand according to your roadmap. Do you envision porting pure Python libraries as part of the effort, or perhaps help other communities do so? For example einsum in numpy or pytorch are great, but how much more work would be needed to have a mojo-accelerated einsum interfacing with numpy or mojo-specialized arrays? Or have a pure mojo numpy altogether?
I think some of this consideration, and resulting work is already being looked at in the context of Numba. They came up with PIXIE (Portable Instructions eXchanged in Executable), the concept being to compile your functions into a shared library which embed the low-level compiler IR, and can then be JIT compiled, or "pulled" in at link-time.
Modular can do exactly the same with existing Python packages, and lift them into Mojo that way.
I really like the integration of lower-level memory control in a superset of Python. Trying to maintain compatibility with such a large and varied ecosystem is a daunting task, and has the opportunity to be very valuable for many people who don't want (or are unable) to move away from the Python ecosystem. Kudos to you all for tackling such a difficult problem! Good luck, I look forward to seeing how you guys help to increase efficiency across the board!
I notice that Mojo still seems to use numpy or something that looks "numpyish" for compatibility. Will Mojo also have an alternative syntax for doing things like matrix multiplication that looks more native like Julia's?
Just wanted to share how much of fan of your work i am. I wish you could gave stayed in the Swift ecosystem. i feel like the language has lost its track since you left.
Looking forward to see where this new adventure will lead, and congratulations !
A lot of companies build web api's around their ML/AI code and data pipelines in Python, is Mojo suited for these task
as well or is it specialized for numerical/AI/ML tasked?
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.