Swift creator brings new AI programming language to the Mac

Posted:
in macOS edited October 2023

New programming language Mojo is now on the Mac, bringing Python-like tools specifically for AI developers.

Mojo flame logo
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

  • Reply 1 of 7
    Fantastic.  Because what the world needs is Yet Another Programming Language.
    coolfactorNoGodsNoMasterswatto_cobrabyronl
  • Reply 2 of 7
    sloth77 said:
    Fantastic.  Because what the world needs is Yet Another Programming Language.

    Yah, I've had it on my bucket list to learn Objective-C for 20+ years, and still haven't.  And then along came Swift and it's still untouched. Python is interesting, and to know that there's a variant of it specifically for AI programming... Mojo will become a very popular language, since Python was already the go-to language for AI programming.
    Japheyiqatedowatto_cobrabyronl
  • Reply 3 of 7

    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.
    edited October 2023 Alex1NJapheywatto_cobrabyronl
  • Reply 4 of 7
    Alex1NAlex1N Posts: 154member

    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.
    Exactly the same here with MacPorts vs. HomeBrew. I used it once, then uninstalled. MacPorts is highly robust and very easy to use.
    watto_cobra
  • Reply 5 of 7
    dewmedewme Posts: 5,763member
    sloth77 said:
    Fantastic.  Because what the world needs is Yet Another Programming Language.

    Yah, I've had it on my bucket list to learn Objective-C for 20+ years, and still haven't.  And then along came Swift and it's still untouched. Python is interesting, and to know that there's a variant of it specifically for AI programming... Mojo will become a very popular language, since Python was already the go-to language for AI programming.

    I think it comes down to deciding whether you want to dabble in multiple programming languages or try to become proficient in one or two programming languages. Heck, being proficient in any one language is a huge undertaking and nearly unattainable if you try to stay up to date with all of the derivations of the language you started with. For example, if you came into programming through K&R C whose reference manual looks like a pamphlet compared to the monstrosities associated with modern languages like C++, Java, C#, or Swift, each of which can trace their language lineage back to C, trying to keep up with each of these derivations, all of which have grown to be massive with their plethora of libraries, is a monumental task. 

    Today, being proficient in a just a single language is nearly impossible when you consider all of the runtime dependencies, operating system dependencies, specialized silos of libraries that address specific domain requirements, like SwiftUI, and of course the constant growth, scope creep, and language extensions that keep being added by the language standardization bodies. Once one language settles on a clever new way to improve a language's capability or improve programmer productivity, every other language that is still being maintained will come up with a way to achieve the same gains within their language's scope. It never ends, unless you as a programmer decide to park yourself in a functional area or job that doesn't feel compelled to keep chasing all of the shiny new things. For example, some embedded programmers can limit their experience and knowledge to something like C++ or even C.

    Being very good at one thing is better, in my opinion, than being average or mediocre at several things. Humans are in fact, lousy multitaskers, despite what some folks claim to be. Don't overfill your bucket. 
    watto_cobraAlex_Vbyronl
  • Reply 6 of 7
    you guys seem not to understand how importsnt this announcement is for Apple Silicon and AI on the Mac! Mojo finally frees us from the tyranny of CUDA . You can go right to the metal instead of passing though other frameworks (Cuda has a stranglehold on AI and Nvidia doesn't support Apple products). So instead of bitching around about another language, read up on mojo and a good start is listening to the Lex Friedman's interview with Chris Lattner: https://m.youtube.com/watch?v=pdJQ8iVTwj8
    byronl
  • Reply 7 of 7
    MarvinMarvin Posts: 15,495moderator
    bohler said:
    you guys seem not to understand how importsnt this announcement is for Apple Silicon and AI on the Mac! Mojo finally frees us from the tyranny of CUDA . You can go right to the metal instead of passing though other frameworks (Cuda has a stranglehold on AI and Nvidia doesn't support Apple products). So instead of bitching around about another language, read up on mojo and a good start is listening to the Lex Friedman's interview with Chris Lattner: https://m.youtube.com/watch?v=pdJQ8iVTwj8
    Apple helped out here by adding Metal support to PyTorch and Tensorflow, Metal is the CUDA replacement:

    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:


    byronl
Sign In or Register to comment.