Version: 1.1.0

Mojo cheat sheets

Cheat sheets are one-page reminders. They are not the manual. Follow a link when a line is too terse to use safely.

Essentials

  • Basics covers declarations, calls, and control flow.
  • Ownership covers argument conventions.
  • Types and literals covers numbers, SIMD, and text.
  • Traits lists the standard behaviors collections expect.
  • Compile-time covers parameters and comptime.

Example

def main():
    var message = "cheat sheet"
    print(message)

Keep in mind

If a sheet and the manual disagree, trust the manual page for that version.