October 19, 2023

MojošŸ”„ is now available on Mac

It's finally here!

We released Mojo local download for Linux systems on September 7th, and in just over a month weā€™ve seen tens of thousands of downloads and amazing community projects such as llama.šŸ”„and Infermo. We deeply value your feedback, as Mojicians, and we appreciate every single PR, feature request, and bug report. Some trends are easy to track, and 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) šŸŽ‰

In this blog post, weā€™ll discuss how you can get started with the Mojo SDK on Mac. We'll take a closer look at how to download and install the Mojo SDK on your Mac, and share popular community projects and resources to help you start your Mojo learning journey. We canā€™t wait to see what youā€™ll build. For a deeper dive on components of the Mojo SDK be sure to check out our launch blog post.

NOTE: This guide is for Mojo on Apple Silicon-based Macs only. Mojo on Intel-based Macs can be installed via Docker containers. Select ā€œSet up on Mac (Intel)ā€ in the developer console for instructions.

Getting started with Mojo SDK

Here are 6 quick steps to experience the power of Mojo on Mac:

  1. First head over to the Modular developer console and sign in or create an account.Ā 
  2. Once youā€™re signed in, select ā€œSet up on Macā€ to see install instructions for Mac
  3. You will need the Homebrew package manager to download the Modular CLI. If you donā€™t already have Homebrew, you can install it from here.Ā 
  4. With Homebrew installed, follow the instructions on the developer console to install Modular CLI using your authentication code.
  5. Use the modular CLI to install Mojo with modular install mojo
  6. Finally, follow the instructions on the output to add Mojo to path on your shell

You are now ready to run your first ā€œHello MojošŸ”„ā€ program using the Mojo REPL. Run :q to exit the REPL environment.

Get the Visual Studio Code extension for Mojo SDK

Visual Studio Code is one of the most popular IDEs in the world, and Mojo supports it directly with an official extension on the Visual Studio Marketplace. The extension supports syntax highlighting, diagnostics, definitions and references, hover help, formatting, and code completion.

Watch this video for an overview of using the MojošŸ”„ Visual Studio Extension šŸš€

Mojo SDK on Mac is āš”fast āš”

Time for some benchmarking. Open a terminal window and clone the Mojo examples repository:

Bash

$ git clone https://github.com/modularml/mojo.git
$ cd mojo/examples

Letā€™s run a matrix multiplication example using matmul.mojo. On My Apple MacBook Pro M2 Max, I get about 90,000x speedup over pure Python šŸ¤Æ

Mojo can take full advantage of Mac CPU cores and vector units to achieve these speedups. Read our blog post series on speeding up Mandelbrot code for tips and tricks to vectorize and parallelize Mojo code to accelerate your applications.

Experience the awesomeness of MojošŸ”„ community projects ā¤ļø

In just over a month, Mojo community members have built and contributed amazing projects. Community member and mojician Vilson has compiled a list of popular Mojo projects, so you can get started quickly: https://github.com/mojicians/awesome-mojo

One of the most popular community projects is llama2.mojo by community member Aydyn Tairov with over 1.2k stars on GitHub. You can read all about Aydynā€™s journey from discovering Mojo to building llama2.mojo in his blog post: How I built llama2.mojo. Llama2.mojo is blazing fast on the Mac and delivers ~960 tok/s.Ā 

Next steps

Weā€™re really excited about bringing Mojo to the Mac user community. We hope you try it out and share your feedback. Here are other ways to get involved:

Donā€™t forget to tune in to Modular Community Livestream - MojošŸ”„ on Mac on Friday, Oct 20th. Weā€™ll discuss all things MojošŸ”„ on Mac and walk you through getting started, discuss Mac-specific features, and share how to build and run Mojo applications on any host! We have a lot of cool demos and a guest speaker.

Lastly, if you were in our Discord last night - you'll have found our Easter Egg šŸ„š - we gave our Discord community access to Mojo šŸ”„ on Mac early! Join the Discord now for future early access.

ā€

Shashank Prasanna
,
AI Developer Advocate

Shashank Prasanna

AI Developer Advocate

Shashank is an engineer, educator and doodler. He writes and talks about machine learning, specialized machine learning hardware (AI Accelerators) and AI Infrastructure in the cloud. He previously worked at Meta, AWS, NVIDIA, MathWorks (MATLAB) and Oracle in developer relations and marketing, product management, and software development roles and hold an M.S. in electrical engineering.