The main Entry Point
Why scripts start at the main function.
Every Program Needs a Start
When you run a Mojo file, the program needs to know where to begin. That starting point is a special function named main. 🚀
Mojo Looks for main
The toolchain searches your file for a function called main and calls it for you. You never call main yourself.
def main():
print("Program started")All lessons in this course
- Your First .mojo File
- The main Entry Point
- Running with mojo run
- Exploring in the Mojo REPL