Mojo 🔥 is now available on Mac🍎!
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:
Anyway, let’s get back to our topic…
Set up Mojo on Mac
- 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!
- 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
andPATH
environment variables, as described in the output when you ranmodular 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: