Skip to main content

Hello World

The video for “Hello World” is in the works!

Every Mux program starts with a main function. This is the entry point where execution begins. Like Python, code outside of functions is also executed when the file runs, but main() is the conventional entry point.

The Simplest Program

The main function is special - it's where your program starts:

  • func main() defines the main function
  • returns void means this function doesn't return a value
  • print() outputs text to the console
Try it yourself
Loading...

Adding Comments

Comments explain your code and are ignored by the compiler:

Try it yourself
Loading...

Running Your Program

Save your code to a file (e.g., hello.mux) and run it:

mux run hello.mux

Next: Variables - Learn how to store and use data in your programs.