Skip to content

Instantly share code, notes, and snippets.

@codejake
Last active May 8, 2026 21:12
Show Gist options
  • Select an option

  • Save codejake/3b2e69ced004bf98f96ccb8b5c854c87 to your computer and use it in GitHub Desktop.

Select an option

Save codejake/3b2e69ced004bf98f96ccb8b5c854c87 to your computer and use it in GitHub Desktop.

Set up a new Mojo project using uv:

uv init hello-mojo && cd hello-mojo
uv venv && source .venv/bin/activate
uv add mojo

Create your first Mojo program:

touch hello.mojo
vi hello.mojo

Add this Mojo code to hello.mojo:

def main():
    print("Hello Mojo!")

Note: main() is the entrypoint for a Mojo program.

Save and quit.

Run hello.mojo with:

mojo hello.mojo

Compile hello.mojo:

mojo build hello.mojo
% ls -lh hello
-rwxr-xr-x@ 1 jake  staff    35K May  8 14:10 hello

Congratulations, you're a Mojo programmer.

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment