Skip to main content

Language basics & overview

What it is: Modular’s official Language basics section. It covers syntax, ownership rules, fn vs def, modules, structs, and the mental model for writing idiomatic Mojo.

Why read it:

  • You get the most up-to-date reference straight from the community-maintained manual.
  • Each chapter mirrors the progression Python or Rust developers expect, so it works as a crash course.
  • The examples stay aligned with the current toolchain releases.

Tips before you click:

  • Skim the overview first to grab the vocabulary. Mojo borrows ideas from Rust and Swift, and the docs explain those terms early.
  • If you already know the language basics, jump to the ownership and lifetimes chapters-they answer 90% of the “why does this move?” questions.

Open Modular’s Language basics