Swift creator brings new AI programming language to the Mac
New programming language Mojo is now on the Mac, bringing Python-like tools specifically for AI developers.
Mojo flame logo
The development of Mojo has been led by Chris Lattner, who was the main driver behind Apple's Swift programming language. While at Apple, he also worked on Xcode, before briefly moving to Tesla, then to the Google Brain AI project in 2017.
In 2022, he co-founded Modular AI, which is the firm behind the new Mojo.
"Mojo is a new programming language for AI developers that will grow into being a superset of Python over time," says the company. "It already supports integrating with arbitrary Python code seamlessly and has a scalable programming model to target performance-critical systems, including accelerators (e.g. GPUs) that are pervasive in AI."
Modular originally launched Mojo on May 2, 2023, with a Mojo Playground tool. It was followed by a Linux edition in September 2023.
"[In] just over a month we've seen tens of thousands of downloads and amazing community projects," said the firm's Shashank Prasanna in a blog post. "[From] all the feedback we received, one request stood out on Discord, on social media and was the most upvoted feedback on GitHub."
"We heard you loud and clear, and today, we are excited to share that Mojo is now available on Mac (Apple Silicon)," it continues.
The company also says that it is possible to use Mojo on Intel-based Macs, "via Docker containers."
Read on AppleInsider
Comments
Installing on Mac requires HomeBrew.
Shame that HomeBrew is getting all of the love, and MacPorts doesn't. MacPorts is vastly easier to use for installing packages! I've used HomeBrew a few times, but always had one problem or another, whereas MacPorts has never failed me.
https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/
https://github.com/apple/tensorflow_macos
https://developer.apple.com/metal/tensorflow-plugin/
Same kind of thing they did with Blender, which had CUDA/OpenCL and they added Metal.
While Mojo will help in other ways, it will still need special code similar to compute libraries like PyTorch, numpy etc. It needs the GPU driver and Metal API to do the work but they can abstract over it.
That video mentions it will take about 1.5-2 years to get the tooling in place to use it in projects.
It says here Lattner was trying to get Swift to replace Python in AI:
https://www.fast.ai/posts/2023-05-03-mojo-launch.html
This approach of improving Python performance using similar techniques in Swift makes more sense because so much AI code is already built on Python and it's an easier language to use.
They have been getting significant speed boosts out of the box and that's a huge benefit to normal Python users. The design of it looks good in that it should be able to run a normal Python project as is and add speedups where needed, like in the below example with over 80x speedup: