0Pricing
Mojo Academy · Lesson

Idiomatic Mojo Habits

Write code that is fast by default.

Fast by Default

The best speed comes from habits, not last-minute tricks. Idiomatic Mojo is written so it is fast from the very first draft. 🚀

Prefer fn in Hot Paths

Reach for fn in code that runs often. Its required types let the compiler optimize the parts of your program that matter most.

fn dot(a: Int, b: Int) -> Int:
    return a * b

All lessons in this course

  1. Writing a Fair Benchmark
  2. Why fn and Types Speed Up
  3. Reading the Numbers Honestly
  4. Idiomatic Mojo Habits
← Back to Mojo Academy