Mojo 🔥 is now available on Mac🍎!

Egemen Eroglu
3 min readOct 21, 2023

--

https://www.modular.com/

While I was randomly scrolling through tabs, a new e-mail suddenly arrived!

Hi folks!

I assume you’ve heard of or tried Mojo while it’s in early access. I was a little more on the tinkering side. At this stage, I tried to contribute to the project and it was fun. You can see a few bugs I found:

https://www.linkedin.com/posts/egemeneroglu_i-was-fortunate-to-have-the-opportunity-to-activity-7069708069886173185-mvfQ?utm_source=share&utm_medium=member_desktop

Anyway, let’s get back to our topic…

Set up Mojo on Mac

  1. Install Homebrew: As a developer using a Mac, I presume you already have Homebrew installed on your computer. If it is not yet available, you can install it by clicking here. Let’s move on!
  2. Install Modular:
brew update
brew install modularml/packages/modular

3. Install Mojo:

modular auth your_auth_key_bla_bla &&
modular install mojo

Before you start:

You must set the MODULAR_HOME and PATH environment variables, as described in the output when you ran modular install mojo. For example, if you’re using bash or zsh, add the following lines to your configuration file (.bash_profile, .bashrc, or .zshrc):

We’ll do some more copy-paste, hang on, we’re so close.

export MODULAR_HOME="$HOME/.modular"
export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH"
source ~/.bash_profile

Let’s type mojo and test it, shall we?

VoilĂ !

If this does not satisfy your curiosity, let’s try writing a function in a file and running it…

I wrote an extremely complex function for you. Don’t worry if you don’t understand. (I must say, the file extension with 🔥 emoji is super cool.)

Anyway, let’s try to run the code:

Hooray!!! 🥳

So, there you have it, a brief introduction to the Mojo programming language 🔥. I hope you’ve found it informative and engaging.

Of course, there’s much more to Mojo than can be covered in a single article. If you’re interested in learning more, I encourage you to visit the official website and explore the documentation.

And who knows, you may even find yourself contributing to the project!

In the meantime, I bid you adieu and hope you have a productive and enjoyable day.

References:

--

--

Egemen Eroglu
Egemen Eroglu

Written by Egemen Eroglu

I write articles about Data Engineering and Data Science | IT R&D Specialist @DHL Express

No responses yet